0
I own property like that
public CustomerTypeRequest Type { get; set; }
That guy(CustomerTypeRequest
) is an Enum, as below
public enum CustomerTypeRequest
{
Guest = 0, //Visitante anônimo
Customer = 1, //Cliente final
Reseller = 2, //Vendedor de uma revenda
}
I need now in a Lambda bring all the ones that are 1 or Customer, like this
var qry = customer.Where(x => x.Type == 1);
What happens is that it gives error and I tried with equals too, no error, but it does not generate data. The error is this:
The operator '==' cannot be applied to type operands "Customertyperequest" and "int"
As a filter my list by this Enum type field?
Thus:
var qry = customer.Where(x => x.Type == CustomerTypeRequest.Customer);
– novic
Answer that I mark
– pnet