public IActionResult OnGetICalFile(string team, string dates) { byte[] file = _twinRinksService.GetICalFile(team, ParseDatesList(dates)); if (file != null) { return(File(file, "text/calendar", $"{team.Replace(" ", "_")}.ics")); } else { return(RedirectToPage(new { SelectedTeam = team })); } }
public IActionResult Get(string team) { team = team.Replace("_", " "); byte[] file = _twinRinksService.GetICalFile(team, null); if (file != null) { return(this.File(file, "text/calendar", $"{team.Replace(" ", "_")}.ics")); } else { return(this.NotFound()); } }