I've found the .NET entity framework less than forgiving thus far (out of context entities f'rinstance). Aside from that, can anyone shed any light on why the following is foo and bar'd?
Any more info needed let me know.Code:// Removed extraneous sanity checking IEnumerable<DataAccess.User> users = from u in ent.Context.UserSet where u.Application.ApplicationId == this.Application.ApplicationId where u.LoweredUserName == userName.ToLower() select u; DataAccess.User user = users.First(); DataAccess.Profile profile = user.Profile // Is always null, what gives? DataAccess.Profile profile2 = (from p in ent.Context.ProfileSet where p.UserId == user.UserId select p).First(); // This works fine, and is how the entity relationship is configured for User.Profile.


LinkBack URL
About LinkBacks
Reply With Quote