开发者

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜