Example #1
0
        public async Task <IHttpActionResult> Update([FromBody] SpecificationAttributeDTO SpecificationAttributeDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var entity = await SpecificationAttributeService.FindOneAsync(SpecificationAttributeDto.Id);

            entity = SpecificationAttributeDto.ToEntity(entity);

            await SpecificationAttributeService.UpdateAsync(entity);

            return(Ok(entity.ToModel()));
        }