Ejemplo n.º 1
0
 public ActionResult <User> InsetUser([FromBody] User usr)
 {
     try
     {
         _UserLogic.Insert(usr);
         var httpcontext = _accessor.HttpContext;
         _Logger.AddOperate <User>("测试", usr);
         Console.WriteLine($" {usr} fefefef {User} ");
         Console.WriteLine($" {usr} fefefef {User} " + "aaa");
         return(usr);
     }
     catch (Exception ex)
     {
         _Logger.Error(ex);
         return(usr);
     }
 }
Ejemplo n.º 2
0
        public ActionResult <User> InsetUser([FromBody] User usr)
        {
            //  throw new Exception("你好");
            //throw new ApplicationException("你好");
            //  throw new OperationFailedException("你好");


            try
            {
                List <int> list = new List <int>();

                for (int i = 1; i <= 100; i++)
                {
                    list.Add(i);
                }

                List <int> result1 = list.FindAll(p => p == 3);

                List <int> result = list.FindAll(
                    delegate(int no)
                {
                    return(no % 2 == 0);
                }
                    );

                //_accessor.HttpContext.Session.SetString("aaa", "bbb");
                //HttpContext.Session.SetString("aaa", "bbb");
                _UserLogic.Insert(usr);
                var httpcontext = _accessor.HttpContext;
                _Logger.AddOperate <User>("测试", usr);
                Console.WriteLine($" {usr} fefefef {User} ");
                Console.WriteLine($" {usr} fefefef {User} " + "aaa");
                return(usr);
            }
            catch (Exception ex)
            {
                _Logger.Error(ex);
                return(usr);
            }
        }