Exemplo n.º 1
0
        public GetSurveysResponse GetSurveys(string course)
        {
            Survey[] res   = null;
            string   error = null;

            try
            {
                using (var db = new SurveyContext())
                {
                    db.Configuration.LazyLoadingEnabled   = false;
                    db.Configuration.ProxyCreationEnabled = false;
                    res = db.getSurveysFor(course);
                }
            }
            catch (Exception e)
            {
                error = e.Message;
            }
            return(new GetSurveysResponse(res, error));
        }
Exemplo n.º 2
0
 public GetSurveysResponse GetSurveys(string course)
 {
     Survey[] res = null;
     string error = null;
     try
     {
         using (var db = new SurveyContext())
         {
             db.Configuration.LazyLoadingEnabled = false;
             db.Configuration.ProxyCreationEnabled = false;
             res = db.getSurveysFor(course);
         }
     }
     catch (Exception e)
     {
         error = e.Message;
     }
     return new GetSurveysResponse(res, error);
 }