I am having few static methods that are repeated in multiple projects (Multiple Solutions) like below. Few Table structures are same in all projects.
Project 1
public static decimal GetBalance(string CustID, MyProj1Context _context)
{
// My Line 1
// My Line 2
// My Line ...N
}
Project 2
public static decimal GetBalance(string CustID, MyProj2Context _context)
{
// My Line 1
// My Line 2
// My Line ...N
}
I want to create a new solution with class library and reference new classlibrary.dll in both projects so I changed _context type to dynamic in class library as to work in both projects but it throws
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.
public static decimal GetBalance(string CustID, dynamic _context)
{
// My Line 1
// My Line 2
// My Line ...N
}
Is there any alternative way to use dynamic DBContext as parameter?
varin place ofdynamicdynamicmeans the type is resolved at runtime instead of at compile time and is generally something you would want to avoid using