public Core.Dto.Customer Create(Core.Dto.Customer customerDto) { var customer = customerDto.ConvertToEntity(); _unitOfWork.BeginTransaction(); _unitOfWork.CustomerRepository.Create(customer); customerDto = customer.ConvertToDto(); _unitOfWork.Commit(); return(customerDto); }
public Core.Dto.Customer Update(Core.Dto.Customer customerDto) { var existingCustomerDto = _unitOfWork.CustomerRepository.Get(customerDto.Id).ConvertToDto(); existingCustomerDto.Name = customerDto.Name; existingCustomerDto.SecurityKey = customerDto.SecurityKey; existingCustomerDto.Enabled = customerDto.Enabled; _unitOfWork.BeginTransaction(); var customer = _unitOfWork.CustomerRepository.Update(existingCustomerDto.ConvertToEntity()); _unitOfWork.Commit(); customerDto = customer.ConvertToDto(); return(customerDto); }
public Core.Dto.Customer Put(Core.Dto.Customer customer) { return(_customerService.Update(customer)); }
public Core.Dto.Customer Post(Core.Dto.Customer customer) { return(_customerService.Create(customer)); }