The suggestion above took await System.Threading.Tasks but it still are not displaying my data. Now I got some NullReferenceException: Object reference not set to an instance of an object. from my QueryableMappingExtensions. Not sure why?
namespace ArtGallery.Core.Mapping
{
using System;
using System.Linq;
using System.Linq.Expressions;
using AutoMapper.QueryableExtensions;
public static class QueryableMappingExtensions
{
public static IQueryable<TDestination> To<TDestination>(
this IQueryable source,
params Expression<Func<TDestination, object>>[] membersToExpand)
{
if (source == null)
{
throw new ArgumentNullException(nameof(source));
}
return source.ProjectTo(AutoMapperConfig.MapperInstance.ConfigurationProvider, null, membersToExpand);
}
public static IQueryable<TDestination> To<TDestination>(
this IQueryable source,
object parameters)
{
if (source == null)
{
throw new ArgumentNullException(nameof(source));
}
return source.ProjectTo<TDestination>(AutoMapperConfig.MapperInstance.ConfigurationProvider, parameters);
}
}
}
Full Error Message
NullReferenceException: Object reference not set to an instance of an object.
This error means that I am trying to access something that is null or does not exist, but I am not sure why is it that as I got the Entity in my database and it is with some inserted data from my Seeder.