Altering lazy-loaded object's private variables
- by Kevin Pang
I'm running into an issue with private setters when using NHibernate and lazy-loading. Let's say I have a class that looks like this:
public class User
{
public int Foo {get; private set;}
public IList<User> Friends {get; set;}
public void SetFirstFriendsFoo()
{
// This line works in a unit test but does nothing…