示例#1
0
        public async Task <RegulationResource> CreateARegulation([FromBody] RegulationViewModel regulation)
        {
            TryValidateModel(regulation);
            var regulationEntity = await _regulationManager.CreateRegulation(regulation);

            return(regulationEntity.ToResource());
        }
        public async Task <RegulationEntity> CreateRegulation(RegulationViewModel regulationViewModel)
        {
            var regulation = new RegulationEntity(regulationViewModel.Description, regulationViewModel.Title);

            _repository.Add(regulation);

            await _uow.Commit();

            var testProduct = await _repository.GetById(regulation.Id);

            return(testProduct);
        }