/// <summary>
 /// Overrides to response html content when accessing the "http://host/api/excel" url in the browser.
 /// </summary>
 /// <returns>The html content.</returns>
 public override IActionResult Get([FromQuery] ExcelRequest re)
 {
     if (C1Controller.IsIntroductionRequest(this))
     {
         return(C1Controller.GetIntroductionPageResult(this, GetExcel()));
     }
     return(base.Get(re));
 }
Пример #2
0
        public override async Task GetAllStudentsFromExcel(ExcelRequest request, IServerStreamWriter <StudentModel> responseStream, ServerCallContext context)
        {
            List <StudentModel> students = GetAllStudents(request.FilePath);

            foreach (StudentModel student in students)
            {
                await responseStream.WriteAsync(student);
            }
        }