public async Task <IViewComponentResult> InvokeAsync(Type entityType, object modelInstance = null, string viewType = "") { var viewModel = new DynamicEntityComponentViewModel(modelInstance) { ViewType = viewType }; return(await Task.FromResult(View(viewModel))); }
public async Task <IViewComponentResult> InvokeAsync(Type entityType, dynamic modelInstance) { var viewModel = new DynamicEntityComponentViewModel(modelInstance) { ModelType = typeof(IEnumerable <>).MakeGenericType(entityType), ModelInstance = modelInstance, Properties = GetPropertiesWithEditorsTypes(entityType) }; //ViewBag.Model = viewModel; //var modelInstance = viewModel.ModelInstance; return(await Task.FromResult(View(viewModel))); }