moved inputs to ctor for better encapsulation

This commit is contained in:
2026-07-18 18:57:59 -05:00
parent 9374ad53e3
commit be5260547b
+3 -3
View File
@@ -209,10 +209,10 @@ customerGroup.MapPost("", async (Customers newCustomerInput, BarkContext db) =>
{ {
Name = newCustomerInput.Name, Name = newCustomerInput.Name,
Email = newCustomerInput.Email, 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); db.Customers.Add(newCustomer);
await db.SaveChangesAsync(); await db.SaveChangesAsync();