Hi, I am new to LINQ, so I am pretty confused here. I have a database and try to run following code.
IQueryable<decimal> location_ids = (from m in _db.Admins
where m.UserId.Equals("c5d3dc0e-81e6-4d6b-a9c3-faa802e10b7d")
select m.LocationId);
if (!location_ids.Contains(new Decimal(conf.umisteni.Budova.ID)))
On the if statement I get an error I don't understand, nor do I know, how to solve it:
System.NotSupportedException: LINQ to Entities does not recognize the method 'Boolean Contains[Decimal](System.Linq.IQueryable`1[System.Decimal], System.Decimal)' method, and this method cannot be translated into a store expression.
at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.DefaultTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)
Any ideas? Thanks in advance