Ejemplo n.º 1
0
        public ActionResult <IEnumerable <string> > TestDb()
        {
            var dog = "dog";

            using (var context = new Kinder2021Context())
            {
                //add students
                for (int i = 1; i < 15; i++)
                {
                    var student = new Student()
                    {
                        CreateDatetime   = DateTime.UtcNow,
                        Name             = "RandomName_" + i.ToString(),
                        LastName1        = "Lastname1_" + i.ToString(),
                        LastName2        = "Lastname2_" + i.ToString(),
                        Birthday         = Convert.ToDateTime("2016-12-" + i.ToString()),
                        CreateUser       = "******",
                        RegistrationDate = DateTime.UtcNow
                    };
                    context.Students.Add(student);
                }
                context.SaveChanges();
                var students = context.Students.ToList();



                return(new JsonResult(students.Select(c => new { c.Name, c.LastName1 })));
            }
        }
Ejemplo n.º 2
0
 public PaymentsRepository(Kinder2021Context context)
 {
     _context = context;
 }
 public TeachersRepository(Kinder2021Context context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
 public GroupsRepository(Kinder2021Context context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Ejemplo n.º 5
0
 public StudentsRepository(Kinder2021Context context)
 {
     _context = context;
 }
 public NinjaRepository(Kinder2021Context context)
 {
     _context = context;
 }
 public ActivityRepository(Kinder2021Context context)
 {
     _context = context;
 }