The probleem seems to be that your
cs
variable is a collection of customers. So when you have this little lambda expressions
p =>p.empid=cs.employeeid
it is not clear which
employeeid
should be taken. Is it the
employeeid
of the first customer, of the last customer or somewhere in between? Try passing in a single customer or specify which element from the list you want.
Alternatively, if
cs
is already a single customer (in which case you should change your class name of
Customers
to
Customer
) it might be that
employeeid
is
nullable[
^].
Nullable types[
^] have a
Value Property[
^] which you should use if you want to compare it's value to another value. You might need to use the
HasValue Property[
^] first to check if it actually has a value so that no
Exception
occurs.
Hope it helps!