Object with Only Id
I want to get an object from my database but only populate it with the unique id identifier. I want all other fields to be null...any ideas on how to app开发者_如何学编程roach this????
Using NHibernate Linq
provider:
Person obj = session.Query<Person>()
.Where(x => x.Id == id)
.Select(x => new Person() { Id = x.Id } )
.SingleOrDefault();
精彩评论