Multi-level foreign key relationships
Closed this issue · 2 comments
igordamasceno96 commented
Guys, how could I implement such a scenario using dommel?
public class Category
{
public int CategoryId { get; set; }
public string Description { get; set; }
publict list<CategoryRule> rules { get; set; }
}
public class CategoryRule
{
public int CategoryRuleId { get; set; }
public string Description { get; set; }
publict int UserId { get; set; }
public User UserRule{get;set;}
}
public class User
{
publict int UserId { get; set; }
public string Name { get; set; }
}
I tried to use it, but it didn't work properly.
Connection.GetAsync<ClientCategory, ClientCategoryRule, User, ClientCategory>(id);
Could someone help me?
@henkmollema @linjiacheng @samuelpampolini @renefc3 @lucaxchaves
henkmollema commented
This is not possible with Dommel unfortunately. You should create two separate queries, or a raw SQL query using Dapper.
igordamasceno96 commented
Understood. Thank you for your attention