예제 #1
0
        public ActionResult Create(TEditModel model)
        {
            var entity = new TEntity();

            EditEntityModelMapper.MergeEntityWithModel(entity, model);

            Repository.Add(entity);

            return(RedirectToAction("Details", new { id = entity.Id }));
        }
예제 #2
0
 private ActionResult SaveExistingEntity(TEditModel model, TEntity existingEntity)
 {
     EditEntityModelMapper.MergeEntityWithModel(existingEntity, model);
     Repository.NotifyItemWasChanged(existingEntity);
     return(RedirectToAction("Details", new { id = existingEntity.Id }));
 }