NuGet Package PeanutButter.Utils.Entity

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.

Info

Version: 1.2.380
Author(s): davyd
Last Update: Tuesday, November 17, 2020
.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.




STATS

must-have-score

6.3

avg-downloads-per-day

79

days-since-last-release

11