Пример #1
0
 public IActionResult Calendar(int skip = 0) => _authenticationProvider.SomeIfAdministrator(User).Map(
     administrator =>
 {
     var now      = DateTime.UtcNow;
     var nowMonth = new DateTime(now.Year, now.Month, 1);
     var month    = nowMonth.AddMonths(-skip);
     var talks    = _talkService.List(month, month.AddMonths(1), administrator.City);
     return((IActionResult)View(new TalkCalendarView(month, CityView.FromDomain(administrator.City), talks.Select(TalkView.FromDomain).ToArray())));
 }
     ).ValueOr(() => RedirectToAction("Administrator", "Authentication"));