public async Task <IActionResult> Create([FromBody] SheetDto sheet) { var isAllowedToCreate = await _contractManager.CheckContractIsActive(sheet.ContractId); if (isAllowedToCreate != null && !(bool)isAllowedToCreate) { return(BadRequest($"Contract {sheet.ContractId} is not active or not found.")); } var id = await _sheetManager.Create(_mapper.Map <Sheet>(sheet)); return(Ok(id)); }