Questions tagged as 'entity-framework'

1
answer

Check for null or empty fields in an entity without consecutive use of "if-else"

In an integration between systems there are data updates on both sides, where the A-side record and the B-side record are obtained. If there are null fields in A and these exist in B then A is complemented with B the reverse is also true, it's l...
asked by 06.10.2017 / 16:00
1
answer

Filtering result by category

using (ObjectContext ctx = new ObjectContext("name=kinectEntities")) { ctx.DefaultContainerName = "kinectEntities"; ObjectSet<produtos> query = ctx.CreateObjectSet<produtos>(); foreach (produtos r in query) {...
asked by 14.09.2017 / 21:36
2
answers

Inheritance in Entity Framework

I have the following structure: Table:    Services (Services table) - with the common properties of all services + Type + ServiceID Table:    Service 1 (Service table1) - with service 1 properties Table:    Service 2 (Service...
asked by 29.06.2017 / 23:44
1
answer

When it does not have a string specification with the configured class where the Entity Framework creates the tables

I created a new project using Asp.Net MVC with EF, and did not configure the connection string property with the same name as the context class: DbContext in Web.config. Rodei enable-migrations - > worked successfully Rodei add-migratio...
asked by 28.09.2017 / 15:48
1
answer

Error creating a distribution of an executable with sql database using the Entity Framework

I'm developing a desktop winforms application with C # in Visual Studio with Sql database through the Entity Framework. The intention is that it be a local database, the program will be installed on isolated machines, which have no access to any...
asked by 02.05.2018 / 19:48
2
answers

Web system accessed by several companies appsettings

I'm developing an ASP.NET Core application, where each company owns its database. The question is: how can I do for the company to access the site by putting user and password and access information of it, remembering that there are several comp...
asked by 01.05.2017 / 07:56
1
answer

Problems when mapping database Entity Framework

I'm having trouble creating a solution for this business rule. I currently have 1 Client, 1 Correspondent and 1 Shop. Both use the same Address table. Since the cliente , correspondente , and loja tables can not have the au...
asked by 27.04.2017 / 16:46
1
answer

How to map the results of a store procedure with an entity using Entity Framework?

Speak up. I'm doing a project with MVC 4 and EF6. I would call a proc and its results populate an entity. But my entity is not a database table, so I did not use Dbset on it. What happens is that this proc joins some tables. I am doing everyt...
asked by 21.06.2017 / 22:35
1
answer

N for N Entity Framework

Dear, I'm trying to make a N to N relationship in the Entity Framework for the tables described below. Atthemomentwhatishappeningisacyclicalredundancy,whereeverytimeIopenaGroup[x].GroupUser[x]atthispointIcaneithergobacktoGroupandfollowUser,a...
asked by 16.12.2016 / 01:54
2
answers

Write only object relationships - Entity Framework [duplicate]

Using the .Net platform with the Entity Framework. I'm persisting an object of class A_B that relates to A and B as code below: public class A_B { private int Id; private string name; private A a; private B b; } public c...
asked by 15.05.2017 / 19:52