How to get parent value from child?
I have pivot table, where 3 foreign keys and 1 values, how to get values parents from foreign keys?
Comments (2)
-
reporter -
reporter Hello, i found solution.
-
Need LINQ query
var q = from a in parameters
join b in unitcategories on a.Parameter_UnitCategoryID equals b.UnitCategory_Id join c in unitcategoriestype on b.UnitCategory_TypeID equals c.UnitCategoryType_Id select new ParameterUnitCategory{ PUC_ID = a.Parameter_Id, PUC_ParameterName = a.Parameter_Name, PUC_UnitCategoryTypeID = b.UnitCategory_TypeID, PUC_UnitCategoryTypeName = c.UnitCategoryType_Name };
return q;
-
Need new Class with types parent attribute
public class ParameterParentValue
{
public int P_Id { get; set; }
public string P_ParameterName { get; set; }
public string P_Value { get; set; }
public string P_UnitName { get; set; }
}
-
- Log in to comment
Table