The return result give null error. Does any anyone has does this before
public T GetList<T>( string sqlQuery, params object[] data)
{
var queryResult = this._db.Query<T>(sqlQuery, new { PersonID = 1 });
var returnResult = Slapper.AutoMapper.MapDynamic<T>(queryResult);
return returnResult;
}
Since you are returning the list, your method signature should return IEnumerable<T>
instead of T (see mapper source code for method signature). Therefore change
public T GetList<T>( string sqlQuery, params object[] data)
to
public IEnumerable<T> GetList<T>( string sqlQuery, params object[] data)
and your method should be working.