entity-framework-core

Return parents with null children using C# EF Core .Include

房东的猫 提交于 2021-02-10 05:23:11
问题 Our goal is to query a database, using Entity Framework Core and the .Include(...) extension method to return a collection of objects that have a child, where some of the children will be null. We have a table Projects with a C# model Project and a table Locations with a C# model Location . Each Project has a one or zero Location objects and the objects look like this: public class Project { public string LocationId { get; set; } public Location Location { get; set; } } public class Location

Dependency injection between two ASP.NET Core projects

痴心易碎 提交于 2021-02-09 12:46:16
问题 I'm currently developing a web application with ASP.NET Core and handling the database with Entity Framework Core. I have two projects in my VS Solution; WebApp (the main application) and DatabaseHandler (the EF Core handler). I have installed Entity Framework Core with the Pomelo package, since I'm using a MySQL database. I've been following the Microsoft documentation to setup EF Core, connection strings and all that, and it works fine. I'm able to make migrations, make updates and do stuff

Dependency injection between two ASP.NET Core projects

偶尔善良 提交于 2021-02-09 12:45:18
问题 I'm currently developing a web application with ASP.NET Core and handling the database with Entity Framework Core. I have two projects in my VS Solution; WebApp (the main application) and DatabaseHandler (the EF Core handler). I have installed Entity Framework Core with the Pomelo package, since I'm using a MySQL database. I've been following the Microsoft documentation to setup EF Core, connection strings and all that, and it works fine. I'm able to make migrations, make updates and do stuff

Change IdentityServer4 Entity Framework table names

痞子三分冷 提交于 2021-02-08 18:49:39
问题 I am trying to change the default table names created by the PersistedGrantDb and ConfigurationDb for IdentityServer4 and have Entity Framework generate the correct SQL. For example; instead of the using the entity IdentityServer4.EntityFramework.Entities.ApiResource using the table ApiResources , I want the data to be mapped into a table named mytesttable According to the documentation this should be as simple as adding ToTable invocations for each entity that I want to remap in the

Change IdentityServer4 Entity Framework table names

走远了吗. 提交于 2021-02-08 18:46:01
问题 I am trying to change the default table names created by the PersistedGrantDb and ConfigurationDb for IdentityServer4 and have Entity Framework generate the correct SQL. For example; instead of the using the entity IdentityServer4.EntityFramework.Entities.ApiResource using the table ApiResources , I want the data to be mapped into a table named mytesttable According to the documentation this should be as simple as adding ToTable invocations for each entity that I want to remap in the

Change IdentityServer4 Entity Framework table names

蓝咒 提交于 2021-02-08 18:40:22
问题 I am trying to change the default table names created by the PersistedGrantDb and ConfigurationDb for IdentityServer4 and have Entity Framework generate the correct SQL. For example; instead of the using the entity IdentityServer4.EntityFramework.Entities.ApiResource using the table ApiResources , I want the data to be mapped into a table named mytesttable According to the documentation this should be as simple as adding ToTable invocations for each entity that I want to remap in the

Change IdentityServer4 Entity Framework table names

∥☆過路亽.° 提交于 2021-02-08 18:37:27
问题 I am trying to change the default table names created by the PersistedGrantDb and ConfigurationDb for IdentityServer4 and have Entity Framework generate the correct SQL. For example; instead of the using the entity IdentityServer4.EntityFramework.Entities.ApiResource using the table ApiResources , I want the data to be mapped into a table named mytesttable According to the documentation this should be as simple as adding ToTable invocations for each entity that I want to remap in the

Change IdentityServer4 Entity Framework table names

孤人 提交于 2021-02-08 18:32:32
问题 I am trying to change the default table names created by the PersistedGrantDb and ConfigurationDb for IdentityServer4 and have Entity Framework generate the correct SQL. For example; instead of the using the entity IdentityServer4.EntityFramework.Entities.ApiResource using the table ApiResources , I want the data to be mapped into a table named mytesttable According to the documentation this should be as simple as adding ToTable invocations for each entity that I want to remap in the

EF Core 2.2, owned entities generated as another table when multiple in hierarchy

我怕爱的太早我们不能终老 提交于 2021-02-08 17:32:28
问题 I have a model with a class Address marked [Owned] and a hierarchy of people (person, customer or employee, then even more subtypes etc). There are addresses at different stages of this hierarchy and all of it ends up in one table as EF Core is limited to table per hierarchy. I expected all the attributes from address to appear multiple times in that person table (once per mention in any of the subtypes) however it doesn't appear at all! Instead i see FK for each of them and a separate

EF Core 2.2, owned entities generated as another table when multiple in hierarchy

橙三吉。 提交于 2021-02-08 17:29:55
问题 I have a model with a class Address marked [Owned] and a hierarchy of people (person, customer or employee, then even more subtypes etc). There are addresses at different stages of this hierarchy and all of it ends up in one table as EF Core is limited to table per hierarchy. I expected all the attributes from address to appear multiple times in that person table (once per mention in any of the subtypes) however it doesn't appear at all! Instead i see FK for each of them and a separate