This is regarding Dapper in ASP.NET MVC3.
I have two tables tblBranchMaster, tblZoneMaster in my database and two class file with same details.
tblBranchMaster(ID, ZoneID, Name);
tblZoneMaster(ID, Name);
Both table having primary key foreign key relationship.
I have a stored procedure which has following query :
Select * from tblBranchMaster;
with some other logical stuff.
Now how should i get result of zone with its related Branch in list.
I have following code base:
List<tblBranchMaster> lstResult = Query<tblBranchMaster, tblZoneMaster, tblBranchMaster>
(tblBranchMaster.uspGetBranchListPagination, (objBranch, objZone) =>
{ objBranch.ZoneMaster = objZone; return objBranch; },
param, splitOn:"Id").ToList();
This code gives me following error:
When using the multi-mapping APIs ensure you set the splitOn param if you have keys other than Id
Parameter name: splitOn
What am I missing???