diff --git a/src/DotNetEd.CoreAdmin/Controllers/CoreAdminDataController.cs b/src/DotNetEd.CoreAdmin/Controllers/CoreAdminDataController.cs index ee976a1..f297905 100644 --- a/src/DotNetEd.CoreAdmin/Controllers/CoreAdminDataController.cs +++ b/src/DotNetEd.CoreAdmin/Controllers/CoreAdminDataController.cs @@ -50,7 +50,7 @@ public IActionResult Index(string id) query = query.Include(property.Name); } - viewModel.Data = (IEnumerable)query; + viewModel.Data = query.ToArray(); viewModel.DbContext = dbContextObject; } } diff --git a/src/DotNetEd.CoreAdmin/Views/CoreAdminData/Index.cshtml b/src/DotNetEd.CoreAdmin/Views/CoreAdminData/Index.cshtml index 81cbc42..a7ffcc6 100644 --- a/src/DotNetEd.CoreAdmin/Views/CoreAdminData/Index.cshtml +++ b/src/DotNetEd.CoreAdmin/Views/CoreAdminData/Index.cshtml @@ -1,4 +1,5 @@ -@using DotNetEd.CoreAdmin +@using System.Collections +@using DotNetEd.CoreAdmin @using Microsoft.Extensions.Localization @using NonFactors.Mvc.Grid @using System.Linq.Expressions @@ -61,7 +62,27 @@ var base64 = ImageUtils.WebBase64EncodeImageByteArrayOrNull(lambda.Compile().Invoke(value)); return base64 == null ? string.Empty : $""; } ).Encoded(false); - } + } + else if (entityProperty.PropertyType.IsAssignableTo(typeof(IEnumerable)) && entityProperty.PropertyType != typeof(string)) + { + var lambda = Expression.Lambda>(property, entity); + + columns.Add(lambda).Titled(entityProperty.Name) + .RenderedAs((value) => + { + var finalString = ""; + return finalString; + } ).Encoded(false); + } /* if (entityProperty.PropertyType == typeof(Guid)) { var lambda = Expression.Lambda>(property, entity);