Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

After EF 6.X upgrade, Include call magically dies...

$
0
0

I thought I had successfully upgraded to EF6, from EF5. I updated my T4 templates and fixed any references and compiler issues that showed up.  But My code is failing and it won't tell me why...

		public virtual User GetSingleUser(string loginName)
		{
			User item = null;

			using (var context = new Entities())
			{
				IQueryable<User> dbQuery = context.Set<User>();

				dbQuery.Include(i => i.Firm);

				item = dbQuery.AsNoTracking().FirstOrDefault(w => w.LoginName == loginName);
			}

			return item;
		}

When I run the app and I hit the dbQuery.Include(), the app just exits the method.  No exception is reported.  If I try to step into the call, same result.

What's different in EF6?  It appears to be syntactically correct.  The compiler doesn't complain.

Help me...  Please...

J


http://digitalcamel.blogspot.com/


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>