Questions tagged [entity-framework-core-3.0]

60 questions
79
votes
5 answers

Client side GroupBy is not supported

I have the following Entity Framework Core 3.0 query: var units = await context.Units .SelectMany(y => y.UnitsI18N) .OrderBy(y => y.Name) .GroupBy(y => y.LanguageCode) .ToDictionaryAsync(y => y.Key, y => y.Select(z => z.Name)); I get the…
Miguel Moura
  • 28,129
  • 59
  • 187
  • 356
42
votes
7 answers

EF Linq Error after change from dotnet Core 2.2.6 to 3.0.0

I'm trying to upgrade a solution to the new Core Framework 3.0.0. Now I'm having a small issue I don't understand. Look, this method was unproblematic in 2.2.6: public async Task> GetBirthdayUsersCurrentMonth() { …
monsee
  • 920
  • 1
  • 8
  • 14
10
votes
2 answers

Entity Framework 3.0 Contains cannot be translated in SQL as it was in EF Core 2.2

I am trying to migrate a Web API from .NET Core 2.2 to .NET Core 3.0 and I have stumbled across the following: public Dictionary GetTagMap(IList tagIds = null) { var tags = context.Tag.AsNoTracking(); if (tagIds != null) …
9
votes
5 answers

Error in Azure Function App VS 2019 .NET 3.0 - Method not found: 'IFunctionsHostBuilder.get_Services()'

Issue with Azure Functions/EFSQLSERVER .NET CORE 3.0: To reproduce: Use Visual Studio 2019 16.2.1 Use Azure Function template to create a project. Changed Target Framework to .NET Core 3.0 Add Microsoft.EntityFrameworkCore.SqlServer" …
6
votes
1 answer

Override EF Core DbContext in ASP.NET Core WebApplicationFactory

I have a ASP.NET Core 2.2 WebApi project which uses also EF Core 2.2. The project is tested via integration tests with WebApplicationFactory. I tried to migrate the the web api project to netcore/aspnetcore 3 which worked out very well. What I've…
6
votes
3 answers

Entity Framework Core 3.0 query causes "SqlException: 'Execution Timeout Expired'" and tempdb become full. Works with EF Core 2.2.6

I'm running a fairly simple query in Microsoft Entity Framework Core 3.0 that looks like this: var dbProfile = db.Profiles.Where(x => x.SiteId == Int32.Parse(id)) .Include(x => x.Interests) .Include(x => x.Pets) .Include(x =>…
5
votes
1 answer

LINQ Breaking changes in EF Core 3.0. How can I compare strings without getting the warning CA1308?

I had the following code, which was running well with EF Core 2.1: .FirstOrDefault(a => (a.Name.Equals(b, StringComparison.InvariantCultureIgnoreCase). (Ok, running well means I got the right results even if it was being evaluated in the client side…
xavier
  • 1,293
  • 3
  • 8
  • 33
5
votes
1 answer

EF Core 3.0 nullable navigational properties

So EF Core preview 7 was released and I decided to use it along with C# 8 previews and .NET Core 3.0 preview 7. Let's say I have a class representing a many-to-many relationship: public class A { public int Id { get; set; } public…
4
votes
1 answer

How to validatie EF Core DBContext config in an unit test

Currently when there is a mistake in the config of the DBContext model, we get an error at run-time. For example: The entity type 'MyObject' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'. This…
Julian
  • 26,655
  • 14
  • 92
  • 132
4
votes
0 answers

Entity Framework 3.0 HasNoKey() for Key less table not working

I am started with .NET Core 3.0 and add ASP.NET Core identity. In tbl_SYS_AspNet_UserRoles there is no primary key. Then I scaffold dbcontext and model for another tables in database, using Entity Framework Core tools reference - .NET CLI and…
kuntal
  • 1,543
  • 2
  • 15
  • 32
3
votes
1 answer

LINQ Breaking changes in EF Core 3.0. Using expressions

In my app I have some queries that use the same repeated logic: var someThings = context.table1 .where(SomeLogic) .ToList(); With EF Core 2.1 I could encapsulate this logic in a layer with all these expressions: public static…
3
votes
1 answer

How to modify expression-based filters to avoid client-side evaluation in Entity Framework Core 3.0

I have the following code that used to convert Func-based filters to Expression and filter the data in Entity Framework Core 2.2: public async Task GetDataAsync(Func filtering = null) where TType : class { …
Nestor
  • 7,076
  • 5
  • 60
  • 117
3
votes
1 answer

Configure MySQL with EFcore 3.0

I just started with Authentication and authorization for SPAs of Dotnet core 3.0 by using dotnet new angular -o -au Individual and it created a new project with Angular as a client side app and ASP.net core as a backend. Now…
Hamza Khanzada
  • 1,102
  • 1
  • 13
  • 29
2
votes
0 answers

After upgrade to EF Core 2.2 => 3.1, Guid ID no longer generated by DbSet.Add()

I'm upgrading from EF Core 2.2 to EF Core 3.1. I have an entity Patient with a GUID Id: class Patient { public Guid Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } } A DbSet is defined for…
2
votes
1 answer

Simplest Group By Fails in EF 3.x with "Client side GroupBy is not supported"

Currently testing with EF Core version 3.1.1. When I search, I find references to this problem, but I don't see any definitive answers about why this happens, and whether it is a bug that will be fixed or if it's expected behavior. This is just as…
Phil Sandler
  • 26,117
  • 19
  • 77
  • 138
1
2 3 4