public async Task AddCommentAsync(Comment comment) { comment.PostedOn = DateTime.Now; comment.Post.CountComments++; _db.Comments.Add(comment); await _db.SaveChangesAsync(); }
public async Task <Post> AddPostAsync(Post post) { _db.Entry(post).State = EntityState.Detached; var result = _db.Posts.Add(post); await _db.SaveChangesAsync(); return(result); }
public async Task SaveAsync() { await _db.SaveChangesAsync(); Dispose(); }
public async Task AddTagAsync(Tag tag) { _db.Tags.Add(tag); await _db.SaveChangesAsync(); }
public async Task CreatePortfolioAsync(Portfolio portfolio) { _db.Portfolios.Add(portfolio); await _db.SaveChangesAsync(); }
public async Task CreateUserAsync(ChiefUser chiefUser) { _db.ChiefUsers.Add(chiefUser); await _db.SaveChangesAsync(); }
public async Task CreateProjectAsync(Project project) { _db.Projects.Add(project); await _db.SaveChangesAsync(); }
public async Task AddCategoryAsync(Category category) { _db.Categories.Add(category); await _db.SaveChangesAsync(); }