private async Task <IWidget> CreateSteamNewsWidget(WidgetSetting data) { ulong count; if (data.Params == null || data.Params.Length == 0) { return(null); } var parameters = data.Params.Split(';'); if (parameters.Length == 1) { return new WidgetNewsSteam { IdWidget = data.Id, Data = await _sModel.GetLastNews(parameters[0]) } } ; try { count = ulong.Parse(parameters[1]); } catch (Exception) { return(null); } return(new WidgetNewsSteam { IdWidget = data.Id, Data = await _sModel.GetLastNews(parameters[0], count) }); }
/** * @brief get the news of the game from the application Id which is a string * * @return a view */ public async Task <IActionResult> News(string appId, ulong count = 1) { var data = await Model.GetLastNews(appId, count); return(View(data)); }