PeanutButter.Utils.Entity NuGet Package

Provides the following:
* EntityBase
- a base entity class to inherit from.

Provides the following fields:
Created (datetime)
LastModified (datetime?)
Enabled (bool)
* DbContextWithAutomaticTrackingFields
- when persisting entities which derive from EntityBase, this will automatically
set Created to the current timestamp on a new entity and update LastModified
on an updated entity
* Extensions to:
- AddRange on an IDbSet
- AddRange on an ICollection
- RemoveRange on an IDbSet
- RemoveRange on an ICollection
- Clear on IDbSet (delete all in dbset)
- AddNew on IDbSet and ICollection
- Convenience method so you can, for example, do:
var someItem = context.SomeCollection.FirstOrDefault(i => i.Name == "bob") ?? context.Collection.AddNew(e => e.Name = "bob");
which finds the first bob or adds a new one
- Transform, which provides a fluent manner to do what you would with Select(), but on a single result.




Got any PeanutButter.Utils.Entity Question?





Info

Version: 2.0.96
Author(s): davyd
Last Update: Tuesday, July 26, 2022
.NET Fiddle: Create the first Fiddle
Project Url: https://github.com/fluffynuts/PeanutButter
NuGet Url: https://www.nuget.org/packages/PeanutButter.Utils.Entity


Install
Install-Package PeanutButter.Utils.Entity
dotnet add package PeanutButter.Utils.Entity
paket add PeanutButter.Utils.Entity
PeanutButter.Utils.Entity Download (Unzip the "nupkg" after downloading)

.NETStandard 2.0 net452 net462 2 packages depend on this package.


Tags



STATS

must-have-score

7

avg-downloads-per-day

99

days-since-last-release

643