The AsScalarAsync extension is used to asynchronously execute what would otherwise be an "immediate execution" query. These are queries using a .First() or .Sum() or .Contains() or similar operator, which because they will be executed immediately and synchronously, are not allowed in Silverlight. To use .Contains, or .Any, or .Count, which I think would also work in your scenario, you can do something like the following: var op = repository.Manager.DBOARD.Select(o1 => o1.ID).AsScalarAsync().Contains(dboard.ID); or var op = repository.Manager.DBOARD.Where(o1 => o1.ID == dboard.ID).AsScalarAsync().Any(); or var op = repository.Manager.DBOARD.Where(o1 => o1.ID == dboard.ID).AsScalarAsync().Count(); Note that in all cases an EntityScalarQueryOperation is returned, not a query. This is because the query is still executed immediately. You can read more about AsScalarAsync here - http://drc.ideablade.com/xwiki/bin/view/Documentation/async-immediate-execution - http://drc.ideablade.com/xwiki/bin/view/Documentation/async-immediate-execution
|