Questions tagged as 'entity-framework'

1
answer

EF relationship coming from Foxpro migration, with compound key

I am migrating a legacy VisualFox system in .Net where the tables were made all out of relationship, in ADO, without foreign key in relationships. Only by comparing a string of the name "Type" to differentiate whether the record in a Table, eg...
asked by 09.05.2017 / 19:20
2
answers

Include all child objects (navigation properies) in entity search

I wonder if it is possible to fetch the fully populated object without having to call include by specifying each child object (with their respective children) in my class. Currently, I'm doing this: dbContext.Ocorrencia.Include("Pe...
asked by 17.03.2017 / 23:08
1
answer

Remove creation of serial column EntityFramework + Npgsql

Hello, I'm creating an application using Fluent API + Entityframework. However in my domain classes when determining that a property is PK it automatically defines it as serial, I would not like to get this behavior because it will automatically...
asked by 25.10.2016 / 03:30
1
answer

Inaccessible Error logs: Security

Good afternoon, recently I've been getting the following error    The source was not found, but some or all event logs could not be   searched. To create the source, you need permission to read all event   logs to make sure that the new sourc...
asked by 26.10.2016 / 18:36
1
answer

Save a complex object with Entity Framework

The system has a Orders screen where you can add new items or change items from that order. The object that is sent to the Repository layer is a complex object 1 x N , that is Pedido and ItensDePedido . My question is: d...
asked by 27.09.2016 / 17:25
2
answers

DbContext finds Connection String in Web Project, but not in Console App project

I have a Class Library project that contains the context, configuration files, and database access classes. Its reference in an Asp.Net MVC project works normally, it accesses the data and etc, but in a project of type Console Applicat...
asked by 29.12.2016 / 19:27
1
answer

Transaction with multiple queries

I was viewing this question , and to try to answer I decided to run some tests where I could see the following problem: When performing multiple database queries via Entity Framework within a single TransactionScope I get the follow...
asked by 08.06.2016 / 22:06
1
answer

BeginTransaction vs TransactionScope

I was reviewing this answer and the question came up: What is the difference between BeginTransaction and TransactionScope ? Are there specific situations for each? What are its advantages and disadvantages compared to each oth...
asked by 09.06.2016 / 13:27
1
answer

Error registering data in ViewModel

I have this question where I where according to the answers, my logic ... Only now, when registering the data, an error was generated. This error refers to the property of a view that can not be null, which is the ID. That is, from what I unde...
asked by 28.05.2016 / 23:00
1
answer

Entity framework many-to-many IEntityChangeTracker error. How to solve?

I have a many-to-many relationship and my tables are correct about the relationship in the database. The problem is that my insert works perfectly when you do not use an existing entity in the database, but when I search the database and add it...
asked by 26.02.2016 / 03:57