public Service UpdateEntireService(Service service, Guid idAccount) { var sectionOrder = 0; if (service.Id == Guid.Empty) { service = SaveService(service, idAccount); } foreach (var serviceDetail in service.ServiceDetails) { serviceDetail.IdService = service.Id; sectionOrder = UpdateSectionsInDataBase(service, serviceDetail, sectionOrder); } service.ServiceDetails.Clear(); service.IdAccount = idAccount; return(_serviceDao.InsertOrUpdate(service)); }