ef-core-3.1 Questions

9

I have recently installed the EF Core 3.1.6 on a home project using postgresql. I have the connection string, and can add migrations easily with the Package Manager Console. If I run my application...
Reclusion asked 30/7, 2020 at 1:17

4

Solved

Is it possible to use a list of enums in an project using EF Core to store the data? My enum: public enum AudienceType { Child, Teen, [Display(Name ="Young Adult")] YoungAdult, Adu...
Dais asked 6/1, 2021 at 18:23

1

According to the Global Query Filters documentation we can't use multiple query filters for an entity, we can only have one, with multiple conditions in it: It is currently not possible to defin...
Dorcasdorcea asked 28/4, 2020 at 22:34

1

I have read about this for in Npgsql and Entity Framework Query PostgreSQL with Npgsql and Entity Framework using unaccent, BUT Entity Framework CORE. Is it posible to do a select for postgresql u...
Ealing asked 6/4, 2020 at 10:16

4

Solved

I'm trying to use the new DbContextFactory pattern discussed in the DbContext configuration section of the EF Core docs. I've got the DbContextFactory up and running successfully in my Blazor app, ...

3

Solved

I upgraded my data layer classlibrary project from .NETCore 2.2 to .NETCore3.1 and also upgraded the Nuget packages like EntityFrameWork Core from 2.2.0 to EFCore 3.1.0. I then on validating the ...
Radbun asked 10/1, 2020 at 13:5

2

Solved

I need to execute a complex sql query in entity framework core 3.1.1, on researching i found out that keyless entity types is the way to go in code first approach. I see lot of documents for dbquer...
Gelid asked 5/2, 2020 at 13:10

1

I'm using EF Core 3.1 to build out my Database Models for SqlServer. I'm also using EF generated migration files to handle database changes. For testing, I'm spinning up in-memory Sqlite relational...
Gustave asked 13/3, 2020 at 2:5

2

Solved

When I go to update my database I run $env:ASPNETCORE_ENVIRONMENT="Development" first before executing the Update-Database command to set the correct environment. If I had previously depl...

6

Solved

I'm writing a new ASP.NET Core Web API, and one of my requirements is to be able to leverage EF Core 3.1 to grab the next value of a sequence defined in my SQL Server as the ID for a record I need ...
Shockley asked 11/3, 2020 at 21:16

4

Solved

How can I prevent synchronous database access with Entity Framework Core? e.g. how can I make sure we are calling ToListAsync() instead of ToList()? I've been trying to get an exception to throw wh...
Astarte asked 6/7, 2020 at 8:37

3

I have a Save object which has several collections associated. Total size of the objects is as follows: The relations between objects can be infered from this mapping, and seem correctly represe...

4

I'm using Microsoft.EntityFrameworkCore.SqlServer (3.1) in a .NET Core 3.1 library. This library gets loaded at runtime by an executable .NET Core project by using: Assembly.LoadFrom('some.dll'); ...

2

Solved

Upon upgrading to EF Core 3, I am getting the following error at the following code: System.InvalidOperationException: 'The LINQ expression 'DbSet .Max(c => Convert.ToInt32(c.ClaimNumber.Substr...

4

I'm updating an EF6.x project to EF Core 3.1. Decided to go back to basics and follow the example of how to set up relationships from scratch again. According to the official Microsoft documentatio...
Graphy asked 20/1, 2020 at 10:38

4

Solved

I have the following class: public class Employee { public string Name {get; set;} ... } and a LINQ query in EF Core 2.1 Employee GetEmployeeByName(string name) { return Context.Employee.Whe...
Carmarthenshire asked 17/1, 2020 at 22:55

2

I'm trying to make my DbContext to work without tracking. public class MyContext: DbContext { public MyContext() { ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; } ....
Lexicostatistics asked 19/4, 2020 at 18:14

1

Solved

We have deployed a very simple .NET CORE 3 Web API application to Azure Cloud. The application is a web api and talks to a very simple SQL server database hosted in Azure as well. There are two mai...

2

I have a Kalem Entity with a collection of DigerKalemMaliyetleri property, which is a collection of MaliyetBirimi objects. DigerKalemMaliyetleri is of JSON type and stored at the same table as a JS...
Kanya asked 15/2, 2021 at 10:37

7

Recently I run add-migration command, and I have some mistakes, so I run remove-migration to undo it. But when I run add-migration again, it said: The name 'blablabla' is used by an existing migrat...
Trope asked 13/3, 2020 at 9:22

1

Solved

At the moment, I'm experiencing an issue where I can create a migration, which has data updates, but the DbContextModelSnapshot has this data. When you look at the updates in the migration, they've...

2

Solved

I have a database table to connect data between user and clients. db: class UserClientCorporate{ int UserId; User User; int ClientCorporateId; ClientCorporate ClientCorporate; } I want to q...
Leatherwood asked 31/1, 2020 at 11:7

1

Solved

I'm trying to scaffold a MySql Database code first using MySql.Data.EntityFrameworkCore and Microsoft.EntityFrameworkCore on .NET Core 3.1 in Visual Studio 2019. However, I keep getting the followi...
Clausen asked 7/12, 2020 at 18:25

2

Solved

I have a model that looks like this: public class Facility { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } public NetTopologySuite.Geometries.Point L...

0

I have created a query that allows group messages based on the reference number and chose each group's latest record. var list = _context.Messages.Include(m => m.SenderId).Include(m => m.Rece...
Decagram asked 14/11, 2020 at 17:10

© 2022 - 2024 — McMap. All rights reserved.