Пример #1
0
        public Guid CreatedId; // Might be a composite key!

        public bool Run(AomMetaViewModel model, IUnitOfWork unitOfWork, Response <AomMetaViewModel> result, ICoreUser user)
        {
            var newCustom = AomMetaMapper.MapInsertModelToDbModel(model);

            unitOfWork.With <AomMeta>().Add(newCustom);
            unitOfWork.SaveChanges();
            CreatedId = newCustom.Id;
            model.Id  = CreatedId; // Might be a composit key
            var newCustomResult = AomMetaMapper.MapDbModelToViewModel(newCustom);

            result.Data = newCustomResult;
            return(true);
        }
        public bool Run(AomMetaViewModel model, IUnitOfWork unitOfWork, Response <AomMetaViewModel> result)
        {
            var newCustom = AomMetaMapper.MapInsertModelToDbModel(model);

            unitOfWork.With <AomMeta>().Add(newCustom);
            unitOfWork.SaveChanges();
            CreatedId = newCustom.Id;
            var newCustomResult = AomMetaMapper.MapDbModelToViewModel(newCustom);

            result.Data = newCustomResult;


            result.Messages.Add(new Message {
                MessageText = "You did it"
            });
            return(true);
        }