I have the following piece of code
public static Func<PurchasingDataContext, int, int, List<Requisition>>
GetRequisitions = CompiledQuery.Compile((PurchasingDataContext context, int userid, int requisitionState)
=> context.Requisitions.Where(r => r.UserId == userid && r.RequisitionId == requisitionState).ToList());
public static List<Requisition> GetRequisitions(int userid, int requisitionState)
{
using (PurchasingDataContext context = new PurchasingDataContext())
{
return GetRequisitions(context, userid, (int)requisitionState);
}
}
and it is producing the following error:
The type 'Purchasing.Data.Requisition' already contains a definition for 'GetRequisitions'
I dont really understand why, I had assumed, perhaps incorrectly that a Func was a method. In which case I am just overloading here. Perhaps it is different, or I am just doing something wrong. Any advice would be great thanks
Will