I am working on DB operations on one project and developing WinForms App C# and I am using Dapper to get data out of DB, I am stuck at situation where I need to retrieve data using inner join. Eg. I've two tables Authors and Book as Follow :
public class Authors
{
public int AuthorId { get; set; }
public string AuthorName { get; set; }
}
public class Book
{
public int BookId { get; set; }
public string AuthorId { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public int Price { get; set; }
}
Now in SQL Server I can easily get the data out of it using following query:
select B.Title,b.Description,b.Price,A.AuthorName from author A inner join book B on A.AuthorId = B.Authorid
But I dont know how to do this with dapper multi mapping, I also saw articles like This but could not understand how it works and splitting. I will be great if i can get same solutions with my class designs. Thank.
This is ouput I want : ResultSet