async Task IWorkingHoursService.UpdateAsync(int id, WorkingHoursDto workingHours) { var json = JsonSerializer.Serialize(workingHours); var data = new StringContent(json, Encoding.UTF8, "application/json"); var response = await Client.PutAsync($"{_workingHoursRequestUri}/{id}", data).ConfigureAwait(false); response.EnsureSuccessStatusCode(); }
async Task IWorkingHoursService.AddAsync(WorkingHoursDto WorkingHours) { var json = JsonSerializer.Serialize(WorkingHours); var data = new StringContent(json, Encoding.UTF8, "application/json"); var response = await Client.PostAsync(_workingHoursRequestUri, data).ConfigureAwait(false); response.EnsureSuccessStatusCode(); }
public static WorkingHours Map(WorkingHoursDto dto) { return(new WorkingHours { Id = dto.Id, Amount = dto.Amount, EmployeeID = dto.EmployeeId, HourlyPrice = dto.HourlyPrice, Employee = EmployeeMapper.Map(dto.Employee), ProjectId = dto.ProjectId }); }
public static WorkingHoursViewModel Map(WorkingHoursDto dto) { return(new WorkingHoursViewModel { WorkingHoursId = dto.Id, Amount = dto.Amount, EmployeeId = dto.EmployeeId, HourlyPrice = dto.HourlyPrice, ProjectId = dto.ProjectId, Employee = EmployeeMapper.Map(dto.Employee), Rowversion = dto.Rowversion }); }
public void Put(int id, [FromBody] WorkingHoursDto value) { _workinghoursService.Update(WorkingHoursMapper.Map(value)); }
public void Post([FromBody] WorkingHoursDto value) { _workinghoursService.Create(WorkingHoursMapper.Map(value)); }