views:

13

answers:

2

I want to check whether records exist under conditions.

This line works fine:

DataContext.Alerts.Count(e => e.MemberShip.email == email) > 0

This line gives error like "Cannot convert lambda expression to type because it is not a delegate type"

DataContext.Alerts.Contains(e => e.MemberShip.email == email)

How can I modify the second statement to make it work?

+1  A: 

use .Alerts.Any(e => e.MemberShip.email == email)

mcintyre321
A: 

You can use DataContext.Alerts.Any(e => e.MemberShip.email == email)

veggerby