public async Task Put(Guid id, [FromBody] TenancyPeriodDto tenancyPeriodDto) { var tenancyPeriod = Mapper.Map <TenancyPeriod>(tenancyPeriodDto); tenancyPeriod.Id = id; await _dbContext.Update(tenancyPeriod); }
public async Task <CreatedResult> Post([FromBody] TenancyPeriodDto tenancyPeriodDto) { var tenancyPeriod = Mapper.Map <TenancyPeriod>(tenancyPeriodDto); var tenancyId = Guid.NewGuid(); tenancyPeriod.Id = tenancyId; await _dbContext.Add(tenancyPeriod); return(Created(new Uri($"/api/TenancyPeriod/{tenancyId}", UriKind.Relative), new { id = tenancyId })); }