Guest User

Guest User

  • Tech Writer
  • 611
  • 127.9k

Face Null Value Error.

Dec 7 2020 11:11 PM
Hello every one .I have face a null value error
I have use three table use with navigation 
 
1. UserMatser -ParentTable
2.UserSub -Child Table
 
it's my query  
 
var Result = _context.UserSubscriptionMaster.Where(x => x.User.UserId == Id).
Select(x => new UserViewProfile()
{
UserName = x.User.UserName,
UserProfilePic = x.User.UserProfilePic,
Plans = x.Plan.PlanName,
UserEmail = x.User.UserEmail
}).FirstOrDefault();
if (Result != null)
obj_Detail.ViewUserDetail = Result;
 
 
It's working .But it's working with data in two table with same id. I have face null value in Data not availabe in two table .
 
 
 

Answers (1)