public async Task <IHttpActionResult> GetRefractoryByRefId(int refId) { var refractory = (await _uow.RefractoryService.GetRefractoryByRefId(refId)); if (refractory == null) { NotFound(); //code 404 } RefractoryViewModel Refaractory = AutoMapper.Mapper.Map <DTORefractory, RefractoryViewModel>(refractory); return(Ok(Refaractory)); }
public async Task <IHttpActionResult> GetRefByBrand([FromBody] RefractoryEditViewModel Refractory) { if (Refractory.RefractoryBrand == null) { NotFound(); //code 404 } var refractory = (await _uow.RefractoryService.GetRefractoryByBrand(Refractory.RefractoryBrand)); if (refractory == null) { NotFound(); //code 404 } RefractoryViewModel refractory_ = AutoMapper.Mapper.Map <DTORefractory, RefractoryViewModel>(refractory); return(Ok(refractory_)); }