public async Task AddAsync(Meeting meeting)
 {
     try
     {
         await meetingService.AddAsync(meeting);
     }
     catch (Exception ex)
     {
         logger.Error($"Exception occured in AddAsync", ex);
     }
 }
        public async Task <ActionResult> Create(
            [Bind("MeetingId,Comments,DateTime,Location,SelectedIssues")]
            MeetingViewModel meeting)
        {
            if (!ModelState.IsValid)
            {
                var quests          = questionnairesService.GetAllQuestionnaires().OrderByDescending(q => q.DateTimeCreated);
                var questViewModels = mapper.Map <List <MeetingQuestionnaireViewModel> >(quests);
                foreach (var questionnaire in questViewModels)
                {
                    var votes = (await questionnairesService.GetVotes(questionnaire.Id)).ToList();
                    questionnaire.Likes = votes.Count;
                }

                ViewBag.AllIssues = questViewModels;
                return(View(meeting));
            }

            var meetingEntity = mapper.Map <Meeting>(meeting);

            await meetingService.AddAsync(meetingEntity);

            return(RedirectToAction("Index"));
        }
 public async Task AddAsync(Meeting meeting)
 {
     logger.Info("Adding new meeting");
     await meetingService.AddAsync(meeting);
 }
Ejemplo n.º 4
0
 public async Task AddAsync(Meeting meeting)
 {
     await policy.ExecuteAsync(async() => await meetingService.AddAsync(meeting));
 }
Ejemplo n.º 5
0
 public async Task <IActionResult> Add([FromRoute] int firmId, MeetingDto request)
 {
     return(HandleServiceResponse(await _service.AddAsync(GetClaims(), firmId, request)));
 }