8
I've created the following POCO class and also made Contact.FirstName and Contact.LastName properties private ( these properties are mapped to appropriate properties in an Entity Framework model ).
public class Contact
{
public int ContactID { get; set; }
private string FirstName { get; set; }
public string LastName { get; private set; }
}
I expected to get an exception due to EF not being able to assign values to these two properties, but somehow EF still managed to assign values to them. How is that possible, since only code in Contact class should have accesses to private properties?
Thank you