示例#1
0
 public HttpResponseMessage Get(string username = null, string password = null)
 {
     using (ElectronicsEntities ee = new ElectronicsEntities())
     {
         if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
         {
             var a = ee.GetAuthors(null, null, null, username, password).FirstOrDefault();
             a.Username = "";
             a.Password = "";
             HttpContext.Current.Session["LoggedAuthor"] = a;
         }
         return(Globals.FinishResponse((Author)HttpContext.Current.Session["LoggedAuthor"]));
     }
 }
示例#2
0
        public HttpResponseMessage Get()
        {
            using (ElectronicsEntities ee = new ElectronicsEntities())
            {
                var ee_authors = ee.GetAuthors(null, null, null, null, null).ToList();

                foreach (var a in ee_authors)
                {
                    a.Username = "";
                    a.Password = "";
                }

                return(Globals.FinishResponse(ee_authors));
            }
        }