i am facing below error
'tblbranch' does not contain a defination of 'tblBranchType' and no accessible method 'tblBranchType' accepting a first argument of 'tblbranch' could found (are you using missing directive or an assembly reference).
var userid = 0;
var usertypeid = 0;
int.TryParse(Convert.ToString(Session["UserID"]), out userid);
int.TryParse(Convert.ToString(Session["UserTypeID"]), out usertypeid);
var listcompanies = new List<CompaniesRequestMV>();
var companies = DB.tblCompanies.ToList();
foreach (var company in companies)
{
var r_company =new CompaniesRequestMV();
r_company.CompanyID = company.CompanyID;
r_company.Company = company.Name;
// Branch
var branch =DB.tblBranches.Where(b=>b.CompanyID == r_company.CompanyID).FirstOrDefault();
r_company.BranchID = branch.BranchID;
r_company.BranchTypeID = branch.BranchTypeID;
var branchtype = branch.tblBranchType == null ? "No Type" : branch.tblBranchType.BranchType;
r_company.BranchType = branchtype;
r_company.BranchName = branch.BranchName;
r_company.BranchContact = branch.BranchContact;
r_company.BranchAddress = branch.BranchAddress;
}