public IActionResult Index() { string ip = ""; var model = new PortraitModel(); //если нет ip, то ничего еще не готово if (HttpContext.Session.Keys.Contains("ipAddress")) { ip = HttpContext.Session.GetString("ipAddress"); if (HttpContext.Session.Keys.Contains("sessionId")) { var sessionId = HttpContext.Session.GetString("sessionId"); var portraitService = new PortraitService(); model = portraitService.GetPortrait(ip, Guid.Parse(sessionId), model); model.IsModelReady = true; } else { model.IsModelReady = false; } } else { model.IsModelReady = false; } return(View(model)); }
/// <summary> /// Initializes a new instance of the <see cref="AmbyCommands"/> class. /// </summary> /// <param name="feedback">The user feedback service.</param> /// <param name="sass">The sass service.</param> /// <param name="portraits">The portrait service.</param> public AmbyCommands ( UserFeedbackService feedback, SassService sass, PortraitService portraits ) { _feedback = feedback; _sass = sass; _portraits = portraits; }
/// <summary> /// Initializes a new instance of the <see cref="MessageRelayingPostExecutionEvent"/> class. /// </summary> /// <param name="interactionAPI">The webhook API.</param> /// <param name="feedback">The feedback service.</param> /// <param name="portraits">The portrait service.</param> /// <param name="content">The content service.</param> public MessageRelayingPostExecutionEvent ( IDiscordRestInteractionAPI interactionAPI, FeedbackService feedback, PortraitService portraits, ContentService content ) { _interactionAPI = interactionAPI; _feedback = feedback; _portraits = portraits; _content = content; }
/// <summary> /// Initializes a new instance of the <see cref="AmbyCommands"/> class. /// </summary> /// <param name="feedback">The user feedback service.</param> /// <param name="sass">The sass service.</param> /// <param name="portraits">The portrait service.</param> /// <param name="context">The command context.</param> /// <param name="channelAPI">The channel API.</param> /// <param name="userAPI">The user API.</param> public AmbyCommands ( FeedbackService feedback, SassService sass, PortraitService portraits, ICommandContext context, IDiscordRestChannelAPI channelAPI, IDiscordRestUserAPI userAPI ) { _feedback = feedback; _sass = sass; _portraits = portraits; _context = context; _channelAPI = channelAPI; _userAPI = userAPI; }
/// <summary> /// Initializes a new instance of the <see cref="AmbassadorCommandBehaviour"/> class. /// </summary> /// <param name="client">The discord client.</param> /// <param name="services">The services.</param> /// <param name="logger">The logging instance for this type.</param> /// <param name="feedback">The feedback service.</param> /// <param name="content">The content service.</param> /// <param name="commands">The command service.</param> /// <param name="help">The help service.</param> /// <param name="portraits">The portrait service.</param> public AmbassadorCommandBehaviour ( DiscordSocketClient client, IServiceProvider services, ILogger <AmbassadorCommandBehaviour> logger, UserFeedbackService feedback, ContentService content, CommandService commands, HelpService help, PortraitService portraits ) : base(client, services, logger, commands) { _feedback = feedback; _content = content; _help = help; _portraits = portraits; }