示例#1
0
        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));
        }
示例#2
0
 public ForumSectionModel Update(string currentUsername, ForumSectionModel input)
 {
     throw new NotImplementedException();
 }
示例#3
0
 public ActionResult Index(ForumSectionModel model)
 {
     model.Save();
     return(View(model));
 }