public void Update(UpdateServiceDTO dto) { var Service = _DB.Services.SingleOrDefault(x => x.Id == dto.Id && !x.IsDeleted); if (Service != null) { Service.Title = dto.Title; Service.Description = dto.Description; Service.UpdatedAt = DateTime.Now; Service.ServiceProviderId = dto.ServiceProviderId; Service.SubSectionId = dto.SubSectionId; _DB.Services.Update(Service); _DB.SaveChanges(); } }
public IActionResult Update([FromBody] UpdateServiceDTO dto) { _ServiceService.Update(dto); return(Ok(GetResponse("Updated"))); }