I have alluded to this issue in my other question, but i think it\'s worthwhile breaking it out into its own question, as it\'s not really dependant on the other scenarios i
you could make the setter internal, and make the internals visible to the repository assembly
[assembly: InternalsVisibleTo("MyLibrary.Repositories")]
public class Post
{
public int PostId { get; internal set; }
public int Name { get; internal set; }
...
}
This means that everything can 'get' those properties, but only this assembly, and the assembly containing the repository, can 'set'