Created
December 8, 2019 11:05
-
-
Save mortezadalil/b430ace6a33044542e6b978e175547f5 to your computer and use it in GitHub Desktop.
This file contains 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 async Task<Post> Add(Post domain) | |
{ | |
var post = new Enities.Post | |
{ | |
Title = domain.Title, | |
CreatedDate = domain.CreatedDate, | |
ModifiedDate = domain.ModifiedDate, | |
Content = domain.Content | |
}; | |
await _cmsDbContext.Posts.AddAsync(post); | |
await _cmsDbContext.SaveChangesAsync(); | |
return new Post | |
{ | |
Content = post.Content, | |
ModifiedDate = post.ModifiedDate, | |
Title = post.Title, | |
CreatedDate = post.CreatedDate, | |
Id = post.Id | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment