public async Task <OutToolDTO> CreateToolAsync(InToolDTO inToolDto) { var tool = await _toolRepository.Create(new Tool() { Name = inToolDto.Tool }); var outToolDto = new OutToolDTO() { Tool = tool.Name }; return(outToolDto); }
public Tool CreateTool(ToolForCreationDto toolForCreation) { //***Validate input; //TODO //map the creation dto to regular tool Tool tool = new Tool() { Name = toolForCreation.Name, Description = toolForCreation.Description, DailyCost = toolForCreation.DailyCost, ReplacementCost = toolForCreation.ReplacementCost, QuantityAvailable = toolForCreation.QuantityAvailable }; Tool createdTool = _toolRepository.Create(tool); return(createdTool); }