tmsmith / Dapper-Extensions

Dapper Extensions is a small library that complements Dapper by adding basic CRUD operations (Get, Insert, Update, Delete) for your POCOs. For more advanced querying scenarios, Dapper Extensions provides a predicate system. The goal of this library is to keep your POCOs pure by not requiring any attributes or base class inheritance.
1.79k stars 586 forks source link

How can I get Child table's data? #264

Closed coderHT closed 3 years ago

coderHT commented 3 years ago

I want to join tables using DapperExtensions. But I'm not sure it was support or not. And I don't want to use Stored Procedures. I only did with Predicate for one table. Following is sample that I want to do.

Parent Table { public int Id {get;set;} public string Name {get;set;} public int ChildId {get;set;} public Child child {get;set;} }

Child Table { public int Id {get;set;} public string ChildName {get;set;} }

=====================================

Parent List

Id Name ChildName 1 Sample SimpleChildName

valfrid-ly commented 3 years ago

Did you map your tables? When you create a reference map you're able to join tables and get the child table.

coderHT commented 3 years ago

Can I get the reference link, please?

valfrid-ly commented 3 years ago

In this test code you can see many different mappings: Inheritance.cs