I have a [Flags] enum like this:
[Flags]
public enum Status
{
None = 0,
Active = 1,
Inactive = 2,
Unknown = 4
}
A Status enum may c
The folloiwng works for me in C#
public const StatusTypes ActiveAlert = StatusTypes.Accepted | StatusTypes.Delivered;
int flags = (int)ActiveAlert;
try
{
var query = from p in model.AlertsHistory
where (p.UserId == clientId
&& (p.Status.HasValue && (p.Status.Value & flags) != 0))
select p;
var aList = query.ToList();
return (aList);
}
catch (Exception exc)
{
log.Error("Exception getting Alerts History for user.", exc);
throw;
}