public ComponentSpecificationMinimal MapToBLL(ComponentSpecificationEdit bllComponentSpecification)
 {
     return(new ComponentSpecificationMinimal
     {
         Id = bllComponentSpecification.Id,
         ComponentId = bllComponentSpecification.ComponentId,
         SpecificationId = bllComponentSpecification.SpecificationId,
         Value = bllComponentSpecification.Value
     });
 }
Example #2
0
        public async Task <IActionResult> PutComponentSpecification(int id,
                                                                    ComponentSpecificationEdit componentSpecification)
        {
            if (id != componentSpecification.Id)
            {
                return(BadRequest());
            }

            _bll.ComponentSpecifications.UpdateNoReturnAsync(_mapper.MapToBLL(componentSpecification));
            await _bll.SaveChangesAsync();

            return(NoContent());
        }