This is the source code( I am using CodeSmith Tools):
public static int Delete(this System.Data.Linq.Table<EAccredidation.Data.Programs> table, int pKProgramID)
{
return table.Delete(p => p.PKProgramID == pKProgramID);
}
I am getting this error:
Cannot convert lambda expression to type 'int' because it is not a delegate type C:\Projects\New\EAccreditation.Data\Queries\ProgramsExtensions.Generated.cs
How can I fix it?
You've stipulated your method as an extension method, so for the purposes of your example, you can ignore the first parameter on the method declaration.
Therefore, the only parameter you are concerned with is the second, int pKProgramID
.
When you call this method (recuirsively) it expects an int, but you are passing a lambda delegate (p => p.PKProgramID == pKProgramID
)
And, as Raymond Chen intimated in his comment, your method is recursive, so you may have further pain ahead of you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With