Exemplo n.º 1
0
 public IntResponse CountLastPanics(CountLastPanicsRequest req)
 {
     int res = -1;
     string error = null;
     try
     {
         if (req.Course == null || req.Seconds == null)
         {
             throw new ArgumentNullException();
         }
         using (var db = new SurveyContext())
         {
             db.Configuration.LazyLoadingEnabled = false;
             db.Configuration.ProxyCreationEnabled = false;
             res = db.CountLastPanics(req.Course, req.Seconds);
         }
     }
     catch (Exception e)
     {
         error = e.Message;
     }
     return new IntResponse(res, error);
 }
Exemplo n.º 2
0
        public IntResponse CountLastPanics(CountLastPanicsRequest req)
        {
            int    res   = -1;
            string error = null;

            try
            {
                if (req.Course == null || req.Seconds == null)
                {
                    throw new ArgumentNullException();
                }
                using (var db = new SurveyContext())
                {
                    db.Configuration.LazyLoadingEnabled   = false;
                    db.Configuration.ProxyCreationEnabled = false;
                    res = db.CountLastPanics(req.Course, req.Seconds);
                }
            }
            catch (Exception e)
            {
                error = e.Message;
            }
            return(new IntResponse(res, error));
        }