entity-framework

How can I hide a database column in the entity model?

Hi. I'm using the Entity Framework 4 and have a question: I have a password column in my database that I want to manage using custom SQL. So I don't want the model to know anything about it. I've tried deleting the property in the Mapping Details window, but then I got a compilation error: Error 3023: Problem in mapping fragments s...

ParentId and Parent type in Entity Framework

I have many entities (Customers, prospects,...) I have one entity called Notes, which can handle notes for Customers,prospects... The Notes table is then: Id Parent_Id Parent_Type Note How to handle this with Entity Framework ? Thanks Joghn ...

Problem with Entity Framework : "The underlying provider failed on Open"

Hi, When I try to insert a record, I get this error : The underlying provider failed on Open. This error occurs only with IIS and not with VWD 2008's webserver. In the EventViewer I get this Application Error : Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection...

Does Entity Framework 4 have a Contains feature?

Right now I am using an extension to linq to provide me with the functionality of Contains. I call the WhereIn like this: Answers = Answers.WhereIn(x => x.category.catid, catSTRarray); Is there a built in function within entity framework to use? ...

Don't see Entity Framework Template after Visual Studio 2010 install on Windows 7 64 bits

I just install Visual Studio 2010 on a 64 bit VM with Windows 7 64 bit. The VM is on an ESXi Hypervisor. When I tried to create my first project I don't see the Entity Framework template (ADO .NET Entity Framework). Am I missing a step here? Any and all help is appreciated. ...

Entity Framework - in model first, how do I get my EF classes to be based on the existing domain classes I have?

Hi, If I already have domain classes, and I want to be able persist them using EF via a model first approach how do I do this? For example do I go to the EF designer (in VS2010) and create the model and generate the classes, then go to these EF classes and somehow manually modify them? But then would there be an issue if I needed to c...

does Entity Framework have a caching mechanism like DataSet/DataTables have?

Hi, does Entity Framework have a caching mechanism like DataSet/DataTables have? In other words if you start using EF is it really just a way to easily get data in/out of the database without providing an additional caching layer like DataSet/DataTables did where you have an in-memory representation (on-line/off-line) and which at some...

how do I set an entity parameter to be UNIQUE in the entity designer?

how do I set an entity parameter to be UNIQUE in the entity designer? that is such that it will cause the database also set set a uniqueness constraint in the database too ...

Does Entity Framework use database connection pooling? and is it by default?

I have been searching for a while about how EF utilizes connections to SQL Server DB, and whether it is using Connection pools under the hood, but I couldn't find any details about that. ...

how to I make a Navigation Property be mandatory in the EF designer? (e.g. make Node always have a NodeType)

Hi, how to I make a Navigation Property be mandatory in the EF designer? (e.g. make Node always have a NodeType) i.e. so that in the database the NODE foreign key to NODE_TYPE has to be set/have a value ...

select width entity framework and linq

hi have 2 table missions and missiondays with a relationship 1..n I want select all missions that has all missiondays with an attribute called "visible" = true I've tried with: db.TDP_Missioni.Include("TDP_MissioniDestinazioni").where(p => p.TDP_MissioniDestinazioni.visible == true) But there is an error. Indeed from p.TDP_Mission...

How significant is a performance penalty for using Int64/bigint instead of Int32/int in a C#4/T-SQL2008 application under 32-bit Windows XP?

For a scientific project of mine I am developing (in C#4 and T-SQL) an application potentially meant to handle very big quantities of very simple records performing simple operations with them (a scientific simulation engine, not a linear time-series cruncher). I'd like to use 64-bit integers as primary keys for better capacity. I am ...

Modelling deterministic and nondeterministic data separately

I'm working with the Microsoft ADO.NET Entity Framework for a game project. Following the advice of other posters on SO, I'm considering modelling deterministic and nondeterministic data separately. The idea for this came from a discussion on multiplayer games, but it seemed to make sense in a single-player scenario as well. Determinist...

Mapped Stored Procedures in EF 1

All, I'm using mapped Stored Procedures in EF 1. I've completed the following steps: I've created my INSERT, UPDATE, and DELETE queries in SQL Server. I've built the EDMX and imported the INSERT, UPDATE, and DELETE sprocs as part of my model. I've set up a Stored Procedure Mapping on a table inside of my EDMX file. The INSERT, UPDAT...

ASP.Net Layered app - Share Entity Data Model amongst layers

How can I share the auto-generated entity data model (generated object classes) amongst all layers of my C# web app whilst only granting query access in the data layer? This uses the typical 3 layer approach: data, business, presentation. My data layer returns an IEnumerable<T> to my business layer, but I cannot return type T to the pre...

Passing an instantiated class to concrete class derived by Castle Windsor

I have a system that I'm using to test some new architecture. I have the following setup (In MVC2 .Net - C Sharp): View < Controller < Service < Repository < DB I'm using Castle Windsor as my DI (IoC) controller, and this is working just fine in both the Service and Repo layers. However, I'm now at a point where I would like to pass an...

How to solve ProviderManifestToken="8.3.7" and Npgsql ProviderManifestToken="8.1.3" conflict?

I'm trying to connect to my PostgreSQL database using Entity Framework. Unfortunately after generating a model using EdmGen (or EdmGen2) in my SSDL file ProviderManifestToken is set to 8.3.7 when in the current version of Npgsql (2.0.9) it is set to 8.1.3. This gives me fallowing exception when trying to use my entity model: System.D...

Does Entity Framework 4 not support property automatic lazy loading for model-first entities?

All references that I find for lazy loading say it's possible but they all mention POCOs and that's it. I am using EF4 with the model-first methodology. In my model diagram I have a Project table and a UserObject table, with a 1 to many relationship between them. However, in code, when I have a valid UserObject and I attempt to get th...

Entity Framework 4.0 Book Recommendations?

Hi, Anyone recommend any good Entity Framework 4.0 books? Ideally in eBook/PDF form. That is the covers the latest version of EF and VS2010. thansk ...

ArgumentNullException from "Entity Designer Database Generation Power Pack" (TPH workflow)

Hi, I'm using EF4 and Model-first-approach. I noticed that the default inheritance strategy is TPT (Table per type). I wasn't satisfied with the performance, so I would like to try TPH instead, but there doesn't seem to be any support for this in the standard Entity Designer(?). I was happy to find the "Entity Designer Database Generat...