Questions tagged as 'entity-framework'

1
answer

AddOrUpdate - use array as parameter

I'm running tests with the Entity Framework and I had a problem putting a array as a parameter. Is this behavior normal? If yes, what name? It works List<Product> product = new List<Product>() var p = product...
asked by 04.11.2015 / 15:32
2
answers

How to do a row count (SELECT COUNT) in Linq

How to make a count of records that a query would return in Linq (Entity Framework) in C #? The equivalent in SQL is to make a SELECT COUNT(*) . Note that I want to receive the direct count of records, just like a SELECT COUNT (*) would...
asked by 21.03.2014 / 15:22
2
answers

Memory Error When Inserting Millions of Records Using Entity Framework

I'm using the Entity Framework to do insert and update thousands of records. At first it was slow, but after putting the code below it improved the speed. db.Configuration.AutoDetectChangesEnabled = false; db.Configuration.ValidateOnSaveE...
asked by 04.09.2015 / 15:14
2
answers

How to access next and previous record with C # using Entity Framework

I'm developing a Windows Form application, with Entity Framework 6 + MySQL. As is common in systems, I have in each form navigation buttons (First Record, Previous Record, Next Record, Last Record) The question: Is there any definite synta...
asked by 02.08.2015 / 02:54
1
answer

Pass two templates to a registration view

I have a sign-up access screen. I have to fill it with values registered in the database. Follow the codes: Models: public partial class Aba { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverr...
asked by 22.05.2016 / 02:28
1
answer

How to fix EntityValidationErrors

Hi, I need some help. After compiling my project I'm getting an error:    Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. I have already discovered that this error is caused in the execu...
asked by 30.05.2014 / 05:26
1
answer

ConnectionString different for different builds

I have two connection string, one when I'm developing that uses my local bank and another for when I deploy the application in Azure. I want the application to know which one to use depending on the type of build I do. What is the simplest wa...
asked by 13.08.2015 / 22:58
1
answer

Problem with .Include () in the Entity Framework (Postgres)

I've been having a problem with EntityFramework, it's the following: When I use the ORM (.Include) string to join tables to foreign keys, it automatically renames the keys in the string automatically generated by it and ends up not finding it...
asked by 19.10.2015 / 17:11
1
answer

Mapping Code First with Data Annotations

I'm creating a project using DataAnnotations mapping with Code First (similar to Hibernate ), without using FluentAPI . It turns out that by implementing this process, some exceptions are being raised and I believe it is due t...
asked by 21.06.2014 / 03:10
1
answer

Help with configuring DbContext with EntityFramework using good practices

I have my application layered with Class Library and my layer with Entity Framework , where I set DbContext , it's Repository . My class inherited from DbContext: public class Context : DbContext { private stati...
asked by 18.03.2014 / 01:36