F
F
FairyFox57002019-04-21 00:16:20
C++ / C#
FairyFox5700, 2019-04-21 00:16:20

How to connect tables in entity framework and select properties by where condition?

I have a table Family and SubFamily. I enter the FamilyName field in the program and I want to get the names of the SubFamilyName based on this field. There is no FamilyName field in the SubFamilyName table, but the tables are related by ID.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ascar, 2019-04-21
@Ascar

Make connections

class SubFamily{
public int Id { get; set; }
public string Name { get; set; }
}

class Family{
public int Id { get; set; }
public string Name { get; set; }
public SubFamily SubFamily { get; set; }
}

family.SubFamily.Name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question