public void SaveNugget(Nugget nugget) { if (nugget.ID == 0) { nugget.Created = DateTime.Now; _dbContext.Nuggets.Add(nugget); ICommentsRepository comments = new CommentsRepository(_dbContext); comments.SaveCommentEvent += new SaveCommentHandler(comments_AddCommentEvent); } _dbContext.SaveChanges(); }
public Nugget SaveNugget(string nuggetTitle, string nuggetDescription, long memberID) { var newNugget = new Nugget { Title = nuggetTitle, Description = nuggetDescription, MemberID = memberID }; _repository.SaveNugget(newNugget); return newNugget; }
public void DeleteNugget(Nugget nugget) { _dbContext.Nuggets.Remove(nugget); _dbContext.SaveChanges(); }
public NuggetViewModel(Nugget nugget) { Description = nugget.Description; Title = nugget.Title; }
public void SaveNugget(Nugget nugget) { _repository.SaveNugget(nugget); }