All Questions
Tagged with asp.net-core-3.0 entity-framework-core
27
questions
-1
votes
1
answer
92
views
Get varied columns from in Entity Framework 3.0
I have an ASP.NET Core MVC solution.
I tried to get dynamic object and uncertainly column numbers and types from a stored procedure.
I prepared the stored procedure, but I couldn't find a solution ...
0
votes
1
answer
172
views
"InvalidOperationException" error showing values from model in ASP.NET Core MVC and Entity Framework Core
I am trying to show values in table from controller to view using model but it shows an error. I have debugged and checked values are returned OK, but the code shows an error. I don't know where is ...
2
votes
2
answers
816
views
My Entity Framework Core API works fine locally, but fails with a 405 error in production
I have a .NetCore 3.1 API project that uses Entity Framework.
It is working perfectly when I run it locally from Visual Studio.
However, after publishing to a production IIS 8.5 server, I get the ...
9
votes
1
answer
15k
views
'MySQLDbContextOptionsBuilder' does not contain a definition for 'ServerVersion'
I've applied ASP.NET Core 3.1 in my project and I want to create database by code-first approach and use MySQL.
In startup.cs file I got this error:
CS1061 'MySQLDbContextOptionsBuilder' does not ...
0
votes
1
answer
64
views
Deleting a listing in table throws a SQL error
I have a .NetCore Entity Framework project for a model airport.
When I try to delete an airport in the listings, I am getting the error below when trying to delete an airline and I'm trying to figure ...
0
votes
1
answer
173
views
A second operation started on this context before a previous operation completed upgrading EF Core 2 to EF Core 3.1.3 [duplicate]
I just tried upgrading from EF Core 2 to EF Core 3. Every call I have is an Async Task<> method, but I'm still getting the A "Second operation started, see https://go.microsoft.com/fwlink/?linkid=...
1
vote
1
answer
579
views
Look up an Id and return a string value
I have a .NetCore 3 Entity Framework controller that returns an object like this:
var games = await _context.Game
.Select(x => new GameEntity
{
Id = x.Id,
Title = x.Title,
...
0
votes
1
answer
1k
views
How can I get one property from a collection and assign it to an array?
I thought this would be easy, but I can't seem to get it to work.
I have a model in my Entity Framework project called _context.Galaxy.
It contains a bunch of different properties, but I only want ...
0
votes
1
answer
304
views
replace a returned property with another property from a different model linking by Id
Hi I'm not quite sure how to do this.
I have this .NetCore EntityFrame controller that gets a list of characters.
It works when I simply get the list of characters by doing this:
return await ...
13
votes
7
answers
27k
views
How to seed in Entity Framework Core 3.0?
I am trying seed the database with some data, using ASP.NET CORE 3.0 and EF Core.
I've created my DbContext and according to documentation, online sources, or even EF Core 2.1 questions (I could not ...
0
votes
1
answer
386
views
Add options when moving from NetCore 2 Newtonsoft JSON to the new JSON API in NetCore 3
I recently upgraded my Entity Framework Core project from DotNet Core 2.2 to 3.1.
I am using newtonsoft json, but I am wondering if I still need these two lines that are causing the errors. Here are ...
2
votes
2
answers
1k
views
How to execute database migrations on startup when using Autofac.AspNetCore.Multitenant in .NET Core 3.x?
In single-tenanted .NET Core apps, EF Core database migrations (and DB seeding) can be executed immediately after the IHost has been built (typically in Program.cs):
await BuildHost(args)
....
-1
votes
1
answer
124
views
.csproj bug in Asp .NET Core MVC
I have wanted to create new table in my database (SQLite), so I created new Model and used it in ApplicationDbContext class like this:
public DbSet<AppUser> AppUsers { get; set; }
public ...
0
votes
1
answer
298
views
How to save 'department id' and 'user id' of 'current logged in user' while saving a record in asp.net core 3.0+?
Previously in asp.net webforms I was used to save current user id, their department id, branch id (in case of multiple branches of organisation), branch name etc in cookies and was using this ...
1
vote
0
answers
337
views
ASP .NET Core 3 - Setup Identity Results in Errors
I am trying to setup a new asp .net core 3 project. I am trying to asp .net identity into it. When I attempt to create a database migration, I get the following error;
An error occurred while ...