예제 #1
0
        public async Task <IResult <Student> > GetOld()
        {
            //throw new Exception("Test EEEEE!");
            //var builder = new DbContextOptionsBuilder<EfDbContext>();



            Student student = new Student();

            student.Id          = IdHelper.GenId();
            student.StudentName = "YH";

            //StudentAddress address = new StudentAddress();
            //address.Student = student;
            //address.Zipcode = 999;
            //address.Id = 111;

            //StudentAddress address2 = new StudentAddress();
            //address2.Student = student;
            //address2.Zipcode = 001;
            //address2.Id = 222;

            //db.AddRange(student, address, address2);
            db.Add(student);

            db.SaveChanges();


            var x = await studentServic.GetStudent();

            var y = await studentServic.GetStudent2();

            DateTime now = DateTime.Now;

            logger.LogInformation("this is test AAAA");

            var log1 = DateTime.Now - now;

            logger.LogWarning("QWWWWWWW");
            var log2 = DateTime.Now - now;



            return(this.Success(y));
        }
예제 #2
0
 public async Task ExecuteAsync(IJobExecutionContext jobContext)
 {
     Console.WriteLine(jobContext.JobDetail.JobDataMap["pxxx"]);//使用了配置中传来的参数,参数的名称要和配置里的一样
     Console.WriteLine((await studentServic.GetStudent()).StudentName);
 }