Skip to main content

All Questions

0 votes
1 answer
164 views

I am unable to store data into database using Entity Framework Core and Ajax

I have a problem with my code. The problem is I am not getting post data by parameter using ajax. Can anyone fix this? The code is shown below. This is Javascript Ajax code where I am sending data ...
SK jha's user avatar
  • 49
0 votes
1 answer
339 views

Linq GroupBy expression raises AnonymousType exception

I have a query that returns an IEnumerable that I use to display a table of values. I would like to group the tables (using a <H3/> element) by the model's DateTime field (StartTime). I ...
craig's user avatar
  • 26.1k
0 votes
1 answer
85 views

Passing a single object from a controller to a view

I have a web-based game built using .netCore 2 and entity framework. The game works, but I just added a new feature. In one of the views, the user can press a button that creates a new character via ...
SkyeBoniwell's user avatar
  • 6,913
3 votes
1 answer
1k views

What could cause `UserManager` to return the wrong user?

Something rather scary is happening on my ASP.NET Core 2.1.0 MVC site. While I was browsing, all of a sudden it shows I am logged in as a different user (who also happens to be browsing the site at ...
Steven Jeuris's user avatar
1 vote
1 answer
1k views

How to get ApplicationDbContext instance in AccountController for ASP .NET Core 2.0 With Individual Authentication?

I'm newbie in ASP .NET Core and need little help. I have created ASP .NET Core 2.0 MVC project with individual authentication. Now I want to access Current ApplicationDbContext in my ...
Zubair Rana's user avatar
  • 2,076
0 votes
1 answer
455 views

How to render a related entity in Razor template

Using ASP.NET Core 2.0, Entity Framework Core, and Visual Studio, I am trying to use a @foreach loop in the razor view to render the List "SecondEntityList" within the Entity1 model. I was able to use ...
crayden's user avatar
  • 2,240
0 votes
1 answer
261 views

Error while loading related data in EntityFrameworkCore

I am getting below error, while loading the related data (coursepages of a course). Error MySqlException: Unknown column 'c.Coursepages.CoursepageId' in 'field list' Point of failure : var ...
Praveen Rai's user avatar
0 votes
2 answers
1k views

ArgumentException: Keyword not supported: 'persistsecurity info' .NET Core MVC 2.0

I'm getting the exception ArgumentException: Keyword not supported: 'persistsecurity info' when attempting to read to the database after upgrading from .NET Core 1.1 to .NET Core 2.0. Project is ...
Isaac's user avatar
  • 310
-1 votes
1 answer
32 views

Why is many to many visible in a Link To Entities Query until I project it out to a SelectItemList?

I have this query. IQueryable<Staff> aolStaff = _userRepo.Users .Include(u => u.StaffOffices).ThenInclude(so => so.Office) .Include(u => u....
Sam's user avatar
  • 5,367
2 votes
1 answer
1k views

Edit Action in ASP.Net Core controller using another field

I have an URL field in my table for each of the courses. And i am using it as route parameter. I did this to make Urls user-friendly and as per my understanding this might also help me in SEO ( Please ...
Praveen Rai's user avatar
0 votes
0 answers
850 views

.net core 2.0 MVC App - HTTP Error 502.5 - Process Failure

So since I have introduced EntityFramework Core into my application and added migrations in order to create the database, my application no longer starts. I get the following error page: The ...
Metzer's user avatar
  • 241
1 vote
0 answers
471 views

ASP.NET Core/EF Core 2.0 using too much memory that results SQL Server Timeouts

tl;dr I am not cleaning up the context, as I assume that is all handled with DI/automatically being scoped (this might be my problem) I have a ASP.NET Core that utilizes EF Core and after a while my ...
Zoinky's user avatar
  • 4,829
10 votes
2 answers
3k views

Mysql Entity Framework issue - Specified key was too long; max key length is 3072 bytes

When I use this command: $ dotnet ef database update I get this error: Specified key was too long; max key length is 3072 bytes The table which cause this error is a built-in Microsoft table for ...
Bob5421's user avatar
  • 8,829
6 votes
1 answer
11k views

Could not load type 'Microsoft.EntityFrameworkCore.Infrastructure.DesignTimeProviderServicesAttribute'

I use Visual Studio for Mac, created a .net core web api project. The csproj file is like this: <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>...
Ori.Lin's user avatar
  • 431
2 votes
1 answer
663 views

ASP.Net Core 2 - Using a DBContext having defaultConnectionString from appsettings

I want to create a basic CRUD in ASP.Net Core 2 with EntityFrameworkCore. My appsettings.json file is like this- "DefaultConnection": "server=localhost; port=3306; database=inventory_management; ...
IT Eng - BU's user avatar

15 30 50 per page