public IViewComponentResult Invoke() { var messages = new List <Message>(); while (messenger.Count() > 0) { messages.Add(messenger.Fetch()); } var options = new MotleyFlashViewComponentOptions(); if (ViewComponentContext.Arguments.ContainsKey(nameof(options.View))) { return(View(ViewComponentContext.Arguments[nameof(options.View)].ToString(), messages)); } else { return(View(messages)); } }