👻 Elektrikli Erol👻
❔ ASP.NET to .net Core
No suitable constructor was found for entity type 'User'. The following constructors had parameters that could not be bound to properties of the entity type:
Cannot bind 'httpContextAccessor' in 'User(IHttpContextAccessor httpContextAccessor, IMemoryCache memoryCache)'
Note that only mapped properties can be bound to constructor parameters. Navigations to related entities, including references to owned types, cannot be bound.'
im getting this error
29 replies
❔ ASP.NET to .net Core
is there anyway i can use HttpContext directly without using constructor like this ? private readonly HttpContext _httpContext;
public User(IHttpContextAccessor httpContextAccessor, IMemoryCache memoryCache)
{
_httpContext = httpContextAccessor.HttpContext;
_cache = memoryCache;
}
29 replies