daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top