For every table, EF generates a partial class, where all fields are publicly accessible, for example
public int ID { get; set; }
Is it possible to make the set
private? I would then only allow the field to be changed calling my custom public method.
Using designer, you can change visibility of setter from property grid. Just click on property, press F4, and select desired visibility:
But I recommend you to select protected
instead of private
, since there could be some difficulties (e.g. see this question).