public BLL.App.DTO.ComponentTypeMinimal MapToBLL(ComponentTypeCreate apiComponentType) { return(new BLL.App.DTO.ComponentTypeMinimal { Id = 0, ComponentTypeName = apiComponentType.ComponentTypeName }); }
public async Task <ActionResult> PostComponentType(ComponentTypeCreate componentType) { if (!User.IsInRole("Admin")) { return(Forbid()); } _bll.ComponentTypes.AddNoReturn(_mapper.MapToBLL(componentType)); await _bll.SaveChangesAsync(); return(Ok()); }