Example #1
0
 public async Task <ActionResult> FindByFullName(string name)
 {
     return(Json(JsonQuery.Create(true).Result(
                     data: await DbContext.Lecturers.Where(l =>
                                                           Regex.IsMatch(l.FullName, name, RegexOptions.IgnoreCase | RegexOptions.Multiline))
                     .ToArrayAsync())));
 }
Example #2
0
        public async Task <IActionResult> GetLecturers()
        {
            var lecturers = await DbContext.Lecturers.ToListAsync();

            // for (int i = 0; i < 1000; i++) {
            //     lecturers.Add (new Lecturer () {
            //         Id = Guid.NewGuid ().ToString (),
            //         FirstName = $"Lecturer {i}",
            //     });
            // }
            return(Json(JsonQuery.Create(true).Result(data: lecturers)));
        }