Created
May 4, 2016 21:02
-
-
Save pwelter34/b24f7f3981b8f624f9a94b8d4be1e403 to your computer and use it in GitHub Desktop.
Change tracking api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ChangeTracker.Default.Configure(c => c | |
.Entity<User>(e => | |
{ | |
e.AutoMap(); | |
e.Property(p => p.FirstName).Equality((original, current) => string.Equal(original, current, IgnoreCase)); | |
e.Property(p => p.Updated).Ignore(); | |
e.Descriptor(e => $"{e.FirstName} {e.LastName}"); | |
}) | |
); | |
var changes = ChangeTracker.Default.Compare(original, current); | |
var friendlyDescription = changes.ToString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment