Exemple #1
0
        /*         public ActionResult<List<Book>> Get() =>
         *          _chapterService.Get(); */
        public async Task <IEnumerable <ChapterViewModel> > GetAllChapters()
        {
            var books = await _chapterService.GetAllChapters();

            var result = mapper.Map <List <Chapter>, IEnumerable <ChapterViewModel> >(books);

            return(result);
        }
Exemple #2
0
 private void HandleRequest()
 {
     Tools.ParseRequestStr(RequestStr, ref requestCode, ref requestData);
     ChapterService.ReturnFromServiceSignal.AddListener(HandleResponse);
     if (requestCode == ChapterEvent.GetAllChapters)
     {
         ChapterService.GetAllChapters();
     }
 }
Exemple #3
0
 public async Task <ApiResponse <IEnumerable <Chapter> > > GetAllChapters()
 {
     try
     {
         return(await _chapterService.GetAllChapters());
     }
     catch (Exception ex)
     {
         return(new ApiResponse <IEnumerable <Chapter> >()
         {
             Success = false, Errors = new List <string>()
             {
                 ex.Message
             }
         });
     }
 }