Last post Sep 04, 2017 07:04 AM by Eric Du
Sep 01, 2017 08:54 AM|bluMarmalade|LINK
In my Asp.net Core 2.0 app I have an ApplicationUser class where I store names and info. But I also have set a navigation property which is a class called "Company" there.
I use this in my controller to get the current user:
var person = await _userManager.GetUserAsync(User);
The problem is that the navigation property is not included in this(the other properties are however. person.Company is null). Is there a way to include it using userManager or do I have to call the ApplicationUser table again after this?
Sep 04, 2017 07:04 AM|Eric Du|LINK
According to your description and code, I think you use lazy loading, if you use lazy loading, please check the following rules:
Rules for lazy loading:
For more details, please check this tutorial link:
I suggest you could use Include() method of eager loading, please check: Eager Loading: