コード例 #1
0
        public Result Create(PageCreateAdminDto dto)
        {
            var result = _validatorCreate.ValidateResult(dto);

            if (!result.Success)
            {
                return(result);
            }


            var entity = Mapper.Map <Page>(dto);

            _pageRepository.Insert(entity);
            _unitOfWork.Commit();

            result.Id = entity.Id;
            PageCacheManager.ClearCache();

            return(result.SetSuccess(Messages.RecordSaved));
        }
コード例 #2
0
 public IHttpActionResult Post([FromBody] PageCreateAdminDto dto)
 {
     return(Result(_pageAdminService.Create(dto)));
 }