The ADO.NET Entity Framework (EF) is .NET's built-in Object-Relational Mapping (ORM) tool. Either natively or through third-party libraries, it supports most major RDBM products including SQL Server, MySQL, Oracle, PostGRE SQL and SQLite. It also supports Microsoft's "LINQ" syntax and ...
0
votes
0answers
12 views
Why is performance so bad on this EF data import method?
I have a loop, abridged here, that performs an import of employee records, as follows:
var cts2005 = new Cts2005Entities();
IEmployeeRepository repository = new EmployeeRepository();
foreach (var c ...
0
votes
0answers
13 views
Entity Framework 4.0: when I try to save some changes with unique constraint I get an exception
Well, I am trying to save a tree in a database, so I am using the modified preorder tree traversal method.
I have a table with the following columns:
IDNode
IDRootNode
IDParentNode
Left
Right
In ...
0
votes
0answers
8 views
Returning Partialview items to Controller in a Questionbank razor application
I am trying to develop a small Questionbank application. Here is how I create a new Questionbank razor page:
@using myWebApp.Utilities;
@using myWebApp.Models
@using System.Linq
@model ...
0
votes
1answer
26 views
How do I can to resolve this error?
Using Entity Framework in C#, I get this error:
The entry 'AlMizanEntities' has already been added.
(D:\Document\Almizan\AlMizan\C#\AlMizan\bin\Debug\AlMizan.vshost.exe.config
line 7)
My ...
0
votes
0answers
18 views
Entity Framework bug with Views?
I use Entity Framework 4.3.1.0
SQL Server 2008 Express
I have Views
SELECT dbo.Dealers.Name AS DealerName,
dbo.Dealers.LogoImage,
dbo.DealersProducts.Price,
...
1
vote
0answers
15 views
Entity Data Model and Encrypted Columns in DB
We have couple of tables on SQl Server DB for which we want to encrypt some columns that have sensitive customer data. We are using EDM for accessing,updating, inserting.. database data. We will ...
0
votes
1answer
20 views
Entity Framework, MySQL, SaveChanges - Error in SQL syntax
This is the error I am getting:
Server Error in '/' Application.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ...
0
votes
0answers
9 views
Obtaining List of Entities in DataContext
What would be the best way to obtain the list of entities loaded in a given EF 4.1 DbContext? I have been unsuccessful in attemps to locate a collection of DbEntityEntry.Entity objects loaded for a ...
0
votes
0answers
25 views
Persistent data with Linq to Sql
I have the following problem: I add a record to sql through Linq default value (-1) in a counter field. After inserting a trigger runs amending counter field (which increases each sees a record is ...
0
votes
1answer
15 views
Why won't my columns with Data Annotations map when using Entity Framework
I have a class that looks like this:
public class Analyst
{
[Column("Internal_ID")]
public int ID { get; set; } // if this is named like the column, it works
[Column("DisplayName")]
...
0
votes
0answers
17 views
Entity in a Windows Service
I built a windows service that uses entity to obtain some data from a remote database. To eliminate possible permission issues I have the service running as my user account. When the database context ...
1
vote
3answers
69 views
Select from two IEnumerables using LINQ
This seems fairly easy but I can't focus.
Let's say I have got 2 classes defined like this:
class Class1
{
public int Document;
public decimal Amount;
}
class Class2
{
public string ...
0
votes
2answers
35 views
EF4 and Creating new record
I'm new to Entity Framework, and my first bit of code already seems incorrect, or at least, not what I expected.
I have generated my entity objects from the database. One of my tables is WebUser. So ...
0
votes
2answers
35 views
Entity Framework Code First Many to Many Mapping is Being Ignored and also not saving
I'm currently working on an application that works with dynamic questionnaire forms.
forms that are defined in a database like so: Forms > Sections > Controls > Questions.
Each Question can have many ...
1
vote
4answers
42 views
Entity-framework. How to report SQL constrain errors gracefully
I have a web-application: ExtJs frontend - EntityFramework + SQL Server as a backend. Let's take a look at one of the error scenarios:
I have database constrains for username (name must be unique)
...