views:

57

answers:

1

This code give me an error:

string rus = "," + db_user.Anagrafica_Dipendente.ID_Dipendente + ",";
int i = db.CBR_User.Count(
    p => p.RiceviMail == true && ("," + p.Dipe + ",").Contains(rus))

p.Dipe is a string

the error is:

Unable to create a constant value of type 'System.Object'.
Only primitive types ('such as Int32, String, and Guid') are supported in this context.

how can i do that?

thanks

A: 

Hi,

What error?

p => p.RiceviMail == true shouldn't it be ( p >= p.RiceviMail ) === true

Bandpay
Hi, i believe i know nothing about this code. Sorry for the comment.
Bandpay