entity-framework

Spatial data types support in Linq2Sql or EF4

Does anyone know (ideally, with a reference), whether the VS2010 release of LinqToSQL or EntityFramework v4 will support queries over the SQL 2008 spatial data types? ...

How do I navigate related entities from a stored procedure that is mapped to an entity

I have a complicated full-text search stored procedure that i have mapped to return an entity type. It won't allow me navigate the references in the result though: using (MyEntities kb = new MyEntities()) { var results = from customer in kb.SearchCustomers("blabla") select new { CustomerName = customer.LastName + "...

What is "Linq to SQL"?

I've had a discussion with a colleague about "Linq to SQL". I am still new at .NET so he thinks I need to learn more. (still, 30 years of general programming experience should count in my advantage, right?) I had read some books and for a new project I decided to use the ADO.NET Entity Data Model. My colleague disagreed because he "knew"...

Alternative to SQL Server for a simple web app

I have a simple app written using SQL Server, Entity Framework, C# and WCF. When I wanted to share this app with my friends, I realised they didn't use SQL Server on their machine. I could go for SQL Server Express edition, as the usage of my app is personal and non-commercial. I found MySQL as a popular alternative to SQL Server. ...

Is there a way to manually raise the PropertyChanged event of an EntityObject?

Hi I am trying to raise the PropertyChanged event of an EntityObject, I don't find a way to do it, is this possible? ...

Can I use a has-many-through style association with the ADO.NET Entity Framework?

I have 3 objects in my model thus: Customer 1-----* Region 1-----* Branch To get the Customer from the Branch in code seems simple enough: branch.Region.Customer I would need to get all of the Branches belonging to a given Customer though and suspect that customer.Regions.Branches would not work due to customer.Regions being a col...

How I can Connect to Oracle in ADO.NET Entity Data Model.

Somebody advice me to use Entity Framework here when I asked this question: what is better to build Data layer, Strongly Typed DataSets or Classes So I read a lot of articles about Entity Framework, I understood that Entity Framework designed to be data-source independent and it will support most of the popular DBMSs. I Have vs2008 wit...

Saving Entity Framework objects in ViewState

Given two tables, Make and Model, where a make can contain many models and resulting in the following EF generated entity types... /// <KeyProperties> /// ID /// </KeyProperties> [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="CarsModel", Name="Make")] [global::System.Runtime.Serialization.DataContractAttr...

Keeping my repository generic using createquery

For my repository using the entity framework i'm using the following method to return a IList. public virtual IList<TEntity> ToList(Func<TEntity, bool> expression) { return Context.CreateQuery<TEntity>("[" + EntitySetName + "]") .Where<TEntity>(expression).ToList(); } The expression pa...

Confused about attaching/detaching entities in EF

Hi, Using ASP.NET MVC and Entity Framework, I encounter some attach/detach errors when I need ti write changes to the database. First heres how I get the records from my repository: public PublishedApplication GetPublishedApplication(int id) { return dal.ExecuteFirstOrDefault( context.PublishedApplication.Include("Customer...

Is it possible to get any database's elements as a set queriable classes with EF?

Hello, I'm trying to make an application in which both the developer and the end user are allowed retrieve data from a relational DB (chosen at runtime) without writing any SQL code at all (and preferably no string concatenations when interacting with the database). The purpose of the application is to two things: a GUI to an expression...

Entity Framework "Code Smells" Question

I'm a fan of Ef and want to use it but I'm not necessarily a fan of how associations work per-se. If I have a simple lookup table containing maybe 3 rows in it and would typically be treated as an enum in code, I don't like that I effectively have to do this to assign a value using the associating in EF: myEntity.MyLookup = db.MyLookups...

Complex Searching with Ado.Net Entity Framework?

What is the best practices for complex searching with ADO.NET Entity Framework. How do you handle complex searching with EF? I am curious about how other developers use EF with detailed,complex searches like E-Shop, Real Estate... etc ? I was using Ayende's for Nhibernate. Thank you ...

Linq to SQL for a new project

Hi guys I am about to start a new project and am deciding what data access technology I will be using... I really like LINQ to SQL for a variety of reasons but should I start the new project using the Entity Framework instead?? I have this perception that the Entity Framework is more bloated and needlessly complicated, thus accounting...

Entity Framework: Cannot access a disposed object. Transaction

We are using Entity Framework and running unit tests within a transaction scope. We were origianally getting the error in the title. I have managed to isolate the problem some what. using (TransactionScope scope1 = new TransactionScope()) { using (TransactionScope scope2 = new TransactionScope()) ...

Using a var based on an enum in a Where clause in Entity Framework throws an exception.

I have the following code which throws an exception (detail in code comments below). I am merely trying to use an instance of an enum as part of the Where clause. I understand the message, but I don't understand why EF cannot parse an Int32 enum. It works if I copy the enum to an Int32 and then filter on that, but it seems very messy. ...

Is Entity Framework provider for Firebird reliable enought?

Has anybody tried to use EF provider (.NET 3.5 SP1) for Firebird (embedded server in my case) in production? Can it be considered stable enough for commercial development? ...

Entity Framework - Where are my Navigation Properties?

When I am generating ADO.NET Entity Data Model from Northwind I am getting well-structured Data Models with both scalar and navigation properties, but when I am generating from my own Database, I get only scalar properties and no navigation properties. Why? and how can I get those navigation properties for my own database Tables? ...

Entity Framework - dynamic sql

I'm implementing a search feature for an app that uses entity framework. There are several optional fields for searching a particular database table/view. What is the best way to implement such a search with EF? Stored procedure? Or can it be done (realistically) using Linq only? ...

FirstOrDefault() type error on return?

A RIA Domain service has this method... public virtual CmsDealer GetCmsDealer(string id) { return this.Context.CmsDealerSet.FirstOrDefault(p => p.Id == id); } The Wcf service has this... public CmsDealer GetDealer(string id) { return domainservice.GetCmsDealer(id); } When called with a nonexistent Id, the GetCmsDealer() cal...