mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-08-11 03:42:01 +00:00
moved inputs to ctor for better encapsulation
This commit is contained in:
@@ -209,10 +209,10 @@ customerGroup.MapPost("", async (Customers newCustomerInput, BarkContext db) =>
|
||||
{
|
||||
Name = newCustomerInput.Name,
|
||||
Email = newCustomerInput.Email,
|
||||
Company = newCustomerInput.Company,
|
||||
PhoneNumber = newCustomerInput.PhoneNumber,
|
||||
Address = newCustomerInput.Address,
|
||||
};
|
||||
newCustomer.Company = newCustomerInput.Company;
|
||||
newCustomer.PhoneNumber = newCustomerInput.PhoneNumber;
|
||||
newCustomer.Address = newCustomerInput.Address;
|
||||
|
||||
db.Customers.Add(newCustomer);
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user