public IActionResult Create(ReportCreateDto dto) { try { return(Create(dto)); } catch (Exception) { throw; } }
public async Task CreateReport(ReportCreateDto reportCreate) { var project = await _projectRepository.GetById(reportCreate.ProjectId); if (project == null) { throw new EntityNotFoundException("", "Project doesn't exist!"); } var report = _mapper.Map <Report>(reportCreate); await _reportRepository.CreateReport(report); }
public async Task <Report> CreateReportAsync(ReportCreateDto reportDto) { var currentReport = this.mapper.Map <Report>(reportDto); await this.reportsRepositroy.AddAsync(currentReport); var statusCode = await this.reportsRepositroy.SaveChangesAsync(); if (statusCode != GlobalConstants.SuccessfullySavedIntoDbContextStatusCode) { return(null); } return(currentReport); }
public async Task <IActionResult> CreateReport([FromBody] ReportCreateDto projectCreateDto) { await _reportService.CreateReport(projectCreateDto); return(Ok()); }
public ReportCreateDto Create(ReportCreateDto dto) { dto.State = "Hazirlaniyor"; _repository.Create(dto.Adapt <Report>()); return(dto); }