コード例 #1
0
        public ActionResult Index()
        {
            //select
            var timer = new Stopwatch();

            timer.Start();



            var test = from abc in db.Tbl_ToDo
                       select new Todo
            {
                Id       = abc.Id,
                TaskName = abc.TaskName
            };
            var test1 = test.ToList();

            timer.Stop();
            var coba1 = db.Tbl_ToDo.ToList();


            var testSP = db.USP_GetAllTask().ToList();

            var timer1 = new Stopwatch();

            timer1.Start();
            var get = todoService.GetTodos();

            timer1.Stop();

            ////insert
            //Tbl_User user = new Tbl_User();
            //user.UserName = "******";
            //user.Password = "******";
            //var inser = db.Tbl_User.Add(user);
            //db.SaveChanges();

            ////update
            //Tbl_User updateUser = db.Tbl_User.Where(x => x.Id == 1).First();
            //updateUser.UserName = "******";
            //db.SaveChanges();

            //delete
            //Tbl_User user = new Tbl_User(x);
            //db.Tbl_User.Remove(user);
            //db.SaveChanges();

            //List<Todo> todos = todoService.GetTodos().ToList();
            return(View());
        }
コード例 #2
0
        public JsonResult GetAllTask()
        {
            var result = db.USP_GetAllTask().ToList();

            return(Json(new { data = result }, JsonRequestBehavior.AllowGet));
        }