Пример #1
0
        public JsonResult GetAllUsers()
        {
            IEnumerable <IUser> temp    = null;
            IDatabaseAdapter    adapter = DatabaseAdapter.Instance();

            //adapter = (DatabaseAdapter)adapter;

            try
            {
                temp = adapter.GetAllUsers();
            }

            catch (System.Exception e)
            {
                throw new System.ArgumentException("Error in getAllUsers() request  Nadina" + e);
            }

            try
            {
                return(Json(temp.ToList(), JsonRequestBehavior.AllowGet));
            }
            catch (System.Exception e)
            {
                throw new System.ArgumentException("Error in JSon request" + e);
            }
        }