Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public class StatesViewModel
  2. {
  3. public string StateCode { get; set; }
  4. }
  5.  
  6. var QryStates = from s in _context.States
  7. where s.StateAbrv != null && s.StateAbrv != string.Empty
  8. select new { s.StateAbrv };
  9.  
  10. var QryCustCount = (from c in ontext.Customers
  11. join qs in QryStates on c.StateAbrv equals qs.StateAbrv
  12. group qs by new { qs.StateAbrv } into grpStateAbrv
  13. select new StatesViewModel{ StateCode = grpStateAbrv.Key.Statecd }).ToList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement