public ForumSectionModel Insert(string currentUsername, ForumSectionModel input) { var user = _usersService.GetByUsername(currentUsername); var entity = _mapper.Map <ForumSectionModel, ForumSection>(input, opt => opt.AfterMap((src, dest) => { dest.CreatedAtUtc = DateTime.UtcNow; dest.CreatedAtUtc = DateTime.UtcNow; dest.CreatedBy = user.UserId; dest.ModifiedAtUtc = DateTime.UtcNow; dest.ModifiedBy = user.UserId; })); _dbContext.ForumSections.Add(entity); _dbContext.SaveChanges(); return(_mapper.Map <ForumSectionModel>(entity)); }
public ForumSectionModel Update(string currentUsername, ForumSectionModel input) { throw new NotImplementedException(); }
public ActionResult Index(ForumSectionModel model) { model.Save(); return(View(model)); }