As long as only the link is returned, your method seems odd:
public CustomerEntity GetCustomer() { Customer = new CustomerEntity(); return Customer; }
The name assumes that it returns a field, instead it creates a new object, overwrites the property, and then returns a link, so each object is created each time.
Probably this method should be as follows:
public CustomerEntity GetCustomer() { return Customer; }
But this is superfluous, since your property already has a getter.
(I assume that CustomerEntity is a class, not a structure, a copy is created for the structures)
source share