Beispiel #1
0
        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)));
        }
Beispiel #2
0
        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)));
        }