Following is the object structure.
public class User{
public string Name{get;set;}
public IList<Address> Addresss {get;set;}
...
}
public class Addresss{
public string Street {get;set;}
...
}
Using Dapper, how this can be written to retrieve User along with List Of Address and that's using Stored Procedure call.
Trying to call like, DbConnection.QueryAsync<User>("storedprocedure",param:null,commandType:CommandType.StoredProcedure)
Stored Procedure query is as,
Select u.*,a.* from user u join address a on u.Id = a.UserId
Expected result as List Of Users where User.Address // should populate with list of associated address.