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)
Dependencies
.NETStandard 2.0
- EntityFramework(>= 6.1.3)
- PeanutButter.Utils(>= 2.0.5)
- EntityFramework(>= 6.1.3)
- PeanutButter.Utils(>= 2.0.5)
- EntityFramework(>= 6.1.3)
- PeanutButter.Utils(>= 2.0.5)
Tags
* 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.