Guest User

Untitled

a guest
Apr 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public JsonResult GetLote(DateTime dataAbate, int numeroSequencia)
  2. {
  3. db.Configuration.ProxyCreationEnabled = false;
  4.  
  5. var query = from a in db.Lotes
  6. join b in db.LoteGeneros on a.LoteId equals b.LoteId
  7. join c in db.Generos on b.GeneroId equals c.GeneroId
  8. where a.DataAbate == dataAbate && (c.SequenciaInicial <= numeroSequencia && c.SequenciaFinal >= numeroSequencia)
  9. select new { NumeroDoLote = a.NumeroLote};
  10.  
  11. if(query.Count() <= 0)
  12. {
  13. //CASO query venha com Count 0
  14. //Como fazer para NumeroDoLote receber 0 (zero)
  15. }
  16.  
  17. return Json(query);
  18. }
Add Comment
Please, Sign In to add comment