public async Task <IActionResult> Create(PostsCreateViewModel model) { if (ModelState.IsValid) { var input = ObjectMapper.Map <CreatePostInput>(model); await _postApplicationService.Create(input); return(RedirectToAction("Index")); } return(View(model)); }
public Task HandleAsync(IUpdateContext context, UpdateDelegate next, CancellationToken cancellationToken) { return(_postApplicationService.Create(new CreatePostInput { Body = context.Update.Message?.Text ?? context.Update.ChannelPost?.Text })); }