entity-framework

Entity Framework and multi-tenancy database design

余生长醉 提交于 2021-02-06 11:27:16
问题 I am looking at multi-tenancy database schema design for an SaaS concept. It will be ASP.NET MVC -> EF, but that isn't so important. Below you can see an example database schema (the Tenant being the Company). The CompanyId is replicated throughout the schema and the primary key has been placed on both the natural key, plus the tenant Id. Plugging this schema into the Entity Framework gives the following errors when I add the tables into the Entity Model file (Model1.edmx): The relationship

Entity Framework and multi-tenancy database design

青春壹個敷衍的年華 提交于 2021-02-06 11:24:40
问题 I am looking at multi-tenancy database schema design for an SaaS concept. It will be ASP.NET MVC -> EF, but that isn't so important. Below you can see an example database schema (the Tenant being the Company). The CompanyId is replicated throughout the schema and the primary key has been placed on both the natural key, plus the tenant Id. Plugging this schema into the Entity Framework gives the following errors when I add the tables into the Entity Model file (Model1.edmx): The relationship

Table Valued Function and Entity Framework

时光毁灭记忆、已成空白 提交于 2021-02-06 08:47:48
问题 I'm trying to execute an TVF with Entity Framework and for some reason it just doesn't work. Maybe anyone out there can help me see the problem. Here are the code samples: That's the function: CREATE FUNCTION [dbo].[udf_profileSearch] (@keywords NVARCHAR(3000)) RETURNS @results TABLE ( [Id] [int] NULL, [SubCategoryId] [int] NULL, [UserId] [int] NULL, [SmallDescription] [nvarchar](250) NULL, [DetailedDescription] [nvarchar](500) NULL, [Graduation] [nvarchar](140) NULL, [Experience] [nvarchar]

Table Valued Function and Entity Framework

只谈情不闲聊 提交于 2021-02-06 08:47:18
问题 I'm trying to execute an TVF with Entity Framework and for some reason it just doesn't work. Maybe anyone out there can help me see the problem. Here are the code samples: That's the function: CREATE FUNCTION [dbo].[udf_profileSearch] (@keywords NVARCHAR(3000)) RETURNS @results TABLE ( [Id] [int] NULL, [SubCategoryId] [int] NULL, [UserId] [int] NULL, [SmallDescription] [nvarchar](250) NULL, [DetailedDescription] [nvarchar](500) NULL, [Graduation] [nvarchar](140) NULL, [Experience] [nvarchar]

Which layer of the application should contain DTO implementation

徘徊边缘 提交于 2021-02-05 13:11:54
问题 Lately I've been hearing a lot about DTOs and how useful they are but I can't find a good example of using it in ASP.NET context. Let's say I use three tier architecture: Data layer(using Entity Framework) Business Layer(WCF Service) Presentation Layer (MVC 4.0 web application) Where should I convert from the EF Employee object to an EmployeeDTO POCO? Lets say I do the conversion in the Data Access layer but what happens in the WCF service? Should it then be converted to another DataMember

Which layer of the application should contain DTO implementation

我们两清 提交于 2021-02-05 13:11:44
问题 Lately I've been hearing a lot about DTOs and how useful they are but I can't find a good example of using it in ASP.NET context. Let's say I use three tier architecture: Data layer(using Entity Framework) Business Layer(WCF Service) Presentation Layer (MVC 4.0 web application) Where should I convert from the EF Employee object to an EmployeeDTO POCO? Lets say I do the conversion in the Data Access layer but what happens in the WCF service? Should it then be converted to another DataMember

Why the “.deps.json” file on release folder and publish output folder size are difference

﹥>﹥吖頭↗ 提交于 2021-02-05 11:52:35
问题 I build on project and checked on release folder size is "280KB" but when I try on publish output file size is "296KB" Tested on .net core 2.0 and VS 2017 回答1: The output in bin/[Configuration] is only meant to be used for local development. Together with the runtimeconfig.dev.json this file specifies the dependency closure of your build output and references are resolved from your local NuGet package cache. If you copy the build output to another machine/user, it will not work. For

Why the “.deps.json” file on release folder and publish output folder size are difference

左心房为你撑大大i 提交于 2021-02-05 11:52:30
问题 I build on project and checked on release folder size is "280KB" but when I try on publish output file size is "296KB" Tested on .net core 2.0 and VS 2017 回答1: The output in bin/[Configuration] is only meant to be used for local development. Together with the runtimeconfig.dev.json this file specifies the dependency closure of your build output and references are resolved from your local NuGet package cache. If you copy the build output to another machine/user, it will not work. For

NullReferenceException in EF Core when using StringComparison overload for predicates

戏子无情 提交于 2021-02-05 11:46:53
问题 We are converting a project from using EF to using EF Core. We have the following line of code which used to work but now does not: // throws NullReferenceException var u = db.Users.FirstOrDefault(x => x.PresenterID.Equals(uid, StringComparison.OrdinalIgnoreCase)); However, if we don't use the StringComparison overload, it works: // this works var u = db.Users.FirstOrDefault(x => x.PresenterID.Equals(uid)); This is a large project and we would like to avoid finding and modifying all code that

Why visual studio doesn't show data source of Firebird

天大地大妈咪最大 提交于 2021-02-05 11:15:13
问题 I have installed Firebird server 3.0 and Firebird ADO.net provider Client 7.1.1.0. I am trying to connect a database of this server via Visual Studio 2015 using entity framework. I have installed DDEX. Now, I can connect a database via server explorer but when I try to add a data model, the data source for Firebird is not in the options. I tried to follow this_link but I was still not successful. This is the image from server explorer where Firebird data source is present and connection is