There are classes:
public class Group { public int Group_id { get; set; } public string GroupName { get; set; } public List<Field> FieldList { get; set; } } public class Field { public int Field_id { get; set; } public string FieldName { get; set; } } There is a request
SELECT gr.id, gr.Name, f.id, f.Name FROM groups gr JOIN dbo.fields f ON gr.id = f.grId Is it possible to fill in a List for 1 request so that there are N fields for each group?
Now I solve this problem by choosing groups, and then in the Foreach cycle I fill the groups with a separate request.