private async Task <CRM.Messages.Customer> UpdateCustomer(TestScope scope, CRM.Messages.Customer dto, string user) { CRM.Model.Customer model; var customers = scope.Get <ICustomerRepository>(); var products = scope.Get <IProductRepository>(); model = customers.Get(dto.CustomerID); model.Update(dto, user, products, customers.DbSession); await customers.SaveChangesAsync(); return(model.CreateDto()); }
private async Task <CRM.Messages.Customer> CreateCustomer(TestScope scope, string name, string user) { CRM.Model.Customer model; var customers = scope.Get <ICustomerRepository>(); var products = scope.Get <IProductRepository>(); var dto = new CRM.Messages.Customer { Name = name, Company = name, }; model = new CRM.Model.Customer(dto, user, products); customers.Add(model); await customers.SaveChangesAsync(); return(model.CreateDto()); }