https://github.com/alsiola/efcoreentityupdater
Implementation of EF6's CurrentValues.SetValues() for EF Core
https://github.com/alsiola/efcoreentityupdater
Last synced: 7 months ago
JSON representation
Implementation of EF6's CurrentValues.SetValues() for EF Core
- Host: GitHub
- URL: https://github.com/alsiola/efcoreentityupdater
- Owner: alsiola
- License: mit
- Created: 2016-12-15T17:30:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T17:42:14.000Z (over 9 years ago)
- Last Synced: 2025-02-22T06:24:15.389Z (over 1 year ago)
- Language: C#
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EFCoreEntityUpdater
Implementation of EF6's CurrentValues.SetValues() for EF Core
#Usage
```c#
class Dog
{
public int Id {get; set;}
public string Name {get; set;}
public string Breed {get;set;}
}
Dog original = new Dog() { Id = 1, Name = "Fido", Breed = "Labrador" }
Dog updated = new Dog() { Id = 0, Name = "Lassie", Breed = "Collie" }
original.UpdateProperties(updated);
Console.WriteLine(original.Id); // 1 - unchanged
Console.WriteLine(original.Name); // Lassie - updated
Console.WriteLine(original.Breed); // Collie - updated
```