Guest User

Untitled

a guest
Apr 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. [ServiceOperation()]
  2. public int GetFooCount(string category, IQueryable<Foo> search)
  3. {
  4. int fooCount;
  5. if (search != null)
  6. {
  7. IQueryable<Foo> filteredFooSet = this.Context.FooSet.Intersect(search);
  8. fooCount = (from foo in filteredFooSet
  9. where foo.Category == category
  10. select foo).Count();
  11. }
  12. else
  13. {
  14. fooCount = (from foo in this.Context.ContactSet
  15. where foo.Category == category
  16. select foo).Count();
  17. }
  18.  
  19. return fooCount;
  20. }
Add Comment
Please, Sign In to add comment