Assume I have the following tables
Table Products
--------
Id (int)
Name (varchar)
BrandId (int)
Table Brands
-----------
Id (int)
BrandName (varchar)
and the following classes in CSharp
public class Product{
public int Id { get; set;}
public string Name { get;}
public ProductBrand Brand { get;}
}
public class ProductBrand{
public int Id { get; set;}
public string BrandName { get;}
}
How can i Select inner join the two tables and map to the ProductBrand model with all its properties in dapper?