It is just an example of my situation

```
 var query =
    Employee.Join(department,
                emp => emp.depId,
                dep=> dep.Id,
                (emp, dep) =>
                    new EmployeeModel{ Name = emp.Name, Total = GetTotal(emp)});

    public string GetTotal(emp)
{
    //dynamically decide which column to pass to the stored procedure, that is 
    //why I am passing the whole object
    total = sp(emp.column1, emp.column2);//here I pass the parameters to SP    
    return total;
}

```

And I get an exception here, I do not know how to solve it.
Any help would be greatly appreciated.
Thanks