pomelo-entityframeworkcore-mysql

The LINQ expression 'OUTER APPLY Projection Mapping in EF .NET Core 5 Exception

拜拜、爱过 提交于 2021-02-11 17:35:42
问题 After migrating from .NET Core 2.x to .NET Core 5.0, we are facing this problem. Error: (Added as a CODE for better readability) The LINQ expression 'OUTER APPLY Projection Mapping: ( SELECT e0.Id, e0.FirstName, e0.MiddleName, e0.LastName FROM Employees AS e0 WHERE (((e0.Status != 4) && EXISTS ( Projection Mapping: SELECT 1 FROM FunctionRoles AS f0 WHERE t.Id == f0.SchoolId)) && (e0.FunctionRoleId == (Projection Mapping: EmptyProjectionMember -> 0 SELECT TOP(1) f1.Id FROM FunctionRoles AS f1

How to use JsonObject of Pomelo.EntityFramework

风流意气都作罢 提交于 2021-02-11 14:15:11
问题 I want to store list of string into mysql table as json. I saw there is support for this in pomelo entityframework. I followed this https://libraries.io/github/tuanbs/Pomelo.EntityFrameworkCore.MySql Here is my entity public class Project { public int Id {get;set;} public string Title {get;set;} public JsonObject<List<string>> Tags {get;set;} } But when _context.Database.EnsureDeleted(); is called it gives below error Navigation property 'Tags' on entity type 'Project' is not virtual.

How to use Pomelo.EntityFrameworkCore.MySql provider for ef core 3 in async mode properly?

为君一笑 提交于 2021-01-07 03:56:03
问题 We are building an asp.net core 3 application which uses ef core 3.0 with Pomelo.EntityFrameworkCore.MySql provider 3.0. Right now we are trying to replace all database calls from sync to async, like: //from dbContext.SaveChanges(); //to await dbContext.SaveChangesAsync(); Unfortunetly when we do it we expereince two issues: Number of connections to the server grows significatntly compared to the same tests for sync calls Average processing speed of our application drops significantly What is

How to use Pomelo.EntityFrameworkCore.MySql provider for ef core 3 in async mode properly?

☆樱花仙子☆ 提交于 2021-01-07 03:55:09
问题 We are building an asp.net core 3 application which uses ef core 3.0 with Pomelo.EntityFrameworkCore.MySql provider 3.0. Right now we are trying to replace all database calls from sync to async, like: //from dbContext.SaveChanges(); //to await dbContext.SaveChangesAsync(); Unfortunetly when we do it we expereince two issues: Number of connections to the server grows significatntly compared to the same tests for sync calls Average processing speed of our application drops significantly What is

Parse JSON array to model .NET Core causes empty set

谁说胖子不能爱 提交于 2020-12-02 02:30:36
问题 By calling DbSet<T>.FromSqlRaw() I can call a Stored Procedure in my Database, which returns a result set like this: Id VARCHAR(36) FirstName VARCHAR(255) LastName VARCHAR(255) NULL Email VARCHAR(255) NULL Numbers VARCHAR(?) NULL Numbers is a VARCHAR field which contains JSON array of SearchContactsNumber : public sealed class SearchContactsNumber { public Guid IdNumber { get; set; } public string Type { get; set; } public string Number { get; set; } } So, for instance, a result set could be

Parse JSON array to model .NET Core causes empty set

点点圈 提交于 2020-12-02 02:25:51
问题 By calling DbSet<T>.FromSqlRaw() I can call a Stored Procedure in my Database, which returns a result set like this: Id VARCHAR(36) FirstName VARCHAR(255) LastName VARCHAR(255) NULL Email VARCHAR(255) NULL Numbers VARCHAR(?) NULL Numbers is a VARCHAR field which contains JSON array of SearchContactsNumber : public sealed class SearchContactsNumber { public Guid IdNumber { get; set; } public string Type { get; set; } public string Number { get; set; } } So, for instance, a result set could be

Linq To Entities: String.Contains a list [duplicate]

混江龙づ霸主 提交于 2020-04-18 05:44:14
问题 This question already has answers here : How do you check if a string contains any strings from a list in Entity Framework? (4 answers) Closed 19 days ago . I am using ASP.net Core 3.0 with Entity Framework Core 3.0 and Pomelo.EntityFrameworkCore provider for MySQL , I need to query all the users that are from specific Towns. Lets say for example I have a list of strings called targettedTowns in which I have the following towns var targettedTowns = new List<string>() {"korangi","landhi","zia

Linq To Entities: String.Contains a list [duplicate]

為{幸葍}努か 提交于 2020-04-18 05:43:46
问题 This question already has answers here : How do you check if a string contains any strings from a list in Entity Framework? (4 answers) Closed 19 days ago . I am using ASP.net Core 3.0 with Entity Framework Core 3.0 and Pomelo.EntityFrameworkCore provider for MySQL , I need to query all the users that are from specific Towns. Lets say for example I have a list of strings called targettedTowns in which I have the following towns var targettedTowns = new List<string>() {"korangi","landhi","zia