Last active
January 27, 2022 17:52
-
-
Save mxmissile/a0beb532ca3a95fb3b19cfcbdd3dbe3b to your computer and use it in GitHub Desktop.
EF test
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
public override async Task<Account> CreateAsync (Account entity, CancellationToken token) | |
{ | |
var context = new Context(); | |
entity.CreateDate = DateTime.Now; | |
entity.LastUpdated = DateTime.Now; | |
if (entity.ParentId == 0) entity.ParentId = 1; | |
context.Accounts.Add(entity); | |
await context.SaveChangesAsync(); | |
return entity; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment