entity-framework

entity framework performance

I am using Entity Framework to layer on my SQL Server 2008 database. The EF is present in my web service and the webservice is invoked by a Silverlight client. I am seeing a serious performance issue in terms of the duration taken by a query to execute in the EF. This wouldn't happen in the consecutive calls. A little bit of googling ...

How do I use an Embedded database with the Entity framework?

I was wondering about the use of the .NET entity framework with an embedded database solution. Right now, I only use the EF with SQL Server but for a new project I'm looking for alternate solutions. SQL Server Compact would be one solution, but are there other alternatives that I can use with EF? Preferably solutions that don't require c...

Fluent Entity Framework Mapping

Hi, Is there any way to perform Fluent EF Mapping like Fluent NHibernate for NHibernate ? ...

Not nullable fields in table inheritance - EDM

I just read this nice article that taught me how to use inheritance (Table-per-hirarchy). I was wondering, say I have a column 'HireDate' that need to use in the sub-class. That's for sure that in the DB it has to marked as nullable, but how can I mark it not nullable in the EDM? I tried to set it as not-nullable, but then it says that ...

How should I separate entities methods ?

Good people of SO, Today I have some serious concerns on my business layer design. It is based on Entity POCO objects and I want to add logic to these entities BUT, there are 2 types of logic: Pure C# logic Persistence logic (LinqToEntities in my case) My question is simple: How should I separate these two kinds ? First, I was thi...

Entity Framework: is it possible to make object context internal?

Hi everyone. I have ObjectContext named for example MyEntities. There is also some entities, let's say they are Entity1 and Entity2. I want to make MyEntities internal. Entity1 and Entity2 must be public. Is it possible? ...

EF SaveChanges() - id vs loaded object to ForeignKey

I found strange thing. For example I have Order and Item entity. Item is reference on Order by id. In EF to save Item, I need firstly load Order, and put it to reference field? Is this only way? Order order = data.OrderSet.FirstOrDefault(b => b.OrderID == OrderId); Item item = new Item { order = order }; data.Add...

Entity Framework and Load Testing

I am having a tough time to understand why this code is failing I have a test method IUnitOfWork unitofwork = EFUnitOfWork.CreateInstance(); IRepository<InformationRequest> informationRequestRepository = unitofwork.CreateRepository<InformationRequest>(); IEnumerable<InformationRequest> requests = informationRequestRepository.ToList();...

Why is TransactionScope causing problems using Entity Framework?

I have a problem that I know is something local, related to transaction scope, probably MSDTC (I don't know very much about it). The other project developer (same codebase, everything commited) executes the whole solution, but when I try to get some data from the database (not always), I have the following error: The underlying provide...

Zend Framework sql update query

How would I write this sql the Zend Framwork way? UPDATE register SET balance = (balance + 10) WHERE added_date > 1259944184 ; I can't find any examples of this on Zends website or the web. Do I need to use "Zend_Db_Expr" ? thanks ...

Is there any way to install EF4 on VS2008 SP1?

After googling, I have only found only this sad forum question. Is it true I can't install EF4 on VS 2008 SP1? And if I can, how to do it - just install .NET 4 beta 2? ...

Unable set table mapping to Boolean = False

Hello folks! I am trying to set an inheritance in Entity-Framework, I want to set the mapping when BooleanColumn = True. I am unable to do so. ...

Entity Framework WCF

[OperationContract] [WebGet(RequestFormat = WebMessageFormat.Json)] public List<DataModal.Employee> GetCustomers() I want to return list of employee which is Entity Model object type. How they can be serialize by default or need to write some code. I am using jquery. ...

Table per hierarchy inheritance with POCO entities in Entity Framework 4

Our organization is looking to standardize on Entity Framework once v4 comes out. As a result, I am looking at what it would take to migrate our application that uses NHibernate for persistence to EF4 using POCO support. In a couple of places we use single table inheritance (also known as Table Per Hierarchy). I have been unable to get i...

Testing internal/closed/sealed System.Data bits. TypeMock or Decorators or xxxxxx?

I'm writing some code that integrates pretty tightly with lots of internal and sealed classes inside of System.Data ( like DbDataRecord and ObjectStateEntry ) for an EntityFramework project I'm working on. Of course the mocking frameworks fall to pieces trying to mock these things. I still need to test these objects and AFAIK my only ...

Is it possible to have multiple Entity Framework edmx's with a shared connection string?

My concept is to have a logging/audit edmx file with corresponding mapped types defined in one project. This edmx has concepts and classes like AuditTrail and PropertyChange A second edmx for the actual application models, domain if you will, with classes like Product, Category, and Order. What I want to do is "scoop up" the first aud...

Can you use the Entity Framework directly from Silverlight?

Every example I see of data access in Silverlight seems to be using the RIA Services to get hold of the entities from the back end. Is it possible to use the Entity Framework directly from Silverlight or is that impossible and hence the need to use RIA Services instead? It would seem that using the Entity Framework directly from Silverl...

Entity framework and deataching objects

When building a web application that uses entity framework in its data access layer, it is recommended to detach objects from the object context to allow objects to be garbage collected. But since the web applications are all request -> response applications, the object context itself is not referenced any more by any live objects afte...

sorting in asp.net

var store = new FMP.AspNetJsonStore({ fields: [ { name: 'AssetID' }, { name: 'AssociationID' }, { name: 'Image' }, { name: 'StatusName' }, { name: 'ModelName' }, { name: 'IPAddress' }, { name: 'InScope', type: 'boolean' }, ...

How do I set up a connection string for a MySQL database in a C# project without using dialog boxes?

NOTE: Apparently, the reason the MySQL connector installation doesn't show up automatically in the Dialog Boxes for adding a data source is because the Visual 2008 Express Edition doesn't allow "3rd party integration" within the Visual Studio IDE. So, this makes setting up the data source manually even more important because the integrat...