entity-framework

Database visualization tool

I just watched a session of PDC09 about new features of Entity framework in .NET 4. Video page: http://microsoftpdc.com/Sessions/FT10 in the video, (seek to minute 7) presenter used a database visualzation tool to open table and view data. Does anyone know what's the name of it and where I can download? ...

Returning Entities + Extra Data with ADO.NET Data Services

Trying to figure out the best way to accomplish this. So I have a table of Stores with properties: StoreID, Name, Latitude, Longitude, etc. I'm using ADO.NET Data Services (Astoria) to create a web service that will show nearby stores given a radius and a coordinate. I made a Service Operation to take the params and return the result...

Separation of Concerns the Repository Pattern & Entity Framework 3.5

Hi, I'm trying to be a better developer... What I'm working with: .Net MVC Framework 1.0 Entity Framework 3.5 I've been doing some reading and I think what i want to do is: Create a repository for each aggregate in the domain. An Order repository for example will manage an Order's OrderItems. Create a service layer to handle busi...

DevArt's dotConnect for Oracle vs DataDirect's ADO.NET data provider

Has anybody done a comparative analysis of dotConnect for Oracle from DevArt and the ADO.NET data provider from DataDirect. We are thinking of using the Entity Framework support available in these frameworks for a critical enterprise application. Some articles that I read suggest the following: DevArt dotConnect is much faster as comp...

How can I do this Eager Loading (using the .Include() method) in this code?

Hi folks, I have a very simple repository I'm playing around with, using Entity Framework v4 that comes with VS2010 Beta 2. I'm trying to dynamically include the Include method, if a user optionally asks for it. eg. Public IQueryable<Foo> GetFoos(bool includeBars) { var entites = new Entities("... connection string ... "); v...

linqpad 4.0 and code only

how do i linqpad with code only in ef 4. i mean how to reference metadata when there is no edmx file? ...

.NET Service burden of using Entity Translator

We have incremental burden of maintaining EntityTranslator to transform the business messages to the service message and service message to business message in .NET and WCF application. In fact, I cannot call them as Business object since we just need to fetch from DB and update the same. We read data from device and store to DB and read...

Is it safe to store an ObjectContext in a thread static variable in ASP.NET?

I've read that I should store an ObjectContext in HttpContext.Current in order to share my ObjectContext across different services/repositories that are called in a request. I'm wondering if it is safe to use an ObjectContext with the [ThreadStatic] attribute on a static class variable instead. Is that a safe thing to do? Is each request...

Entity Framework: Is there a method to compare for equal values of EntityObject?

Is there a simple way to compare two EntityObjects for value-equality. I simply want to check if all the database-values are the same, so I don't care if the EntityKey is different. Is this possible built-in? Or should I just write my own method. I guess Equals() doesn't work as I want it here? ...

Entity Framework: Adding a scalar property which is equal to a FK id

Hi guys Short Question: Basically I am trying to add a scalar property to my entity which holds the ID of a FK entity. What I have tried to do thus far: What I have tried so far is adding the scalar property (called ChildId) and mapped it to the matching column in the database. Now as you can imagine I get some exceptions when I tr...

Entity Framework - WCF - Enums?

Hi, I was wondering how people are handling the lack of Enum support in Entity Framework when dealing with WCF services? Common practice seems to be to declare getter & setter in the entity property to private and then create a partial class for the entity and declare the enum property in there. This is all fine and dandy but pos...

Entity Framework Stub Entities for fetches

Hi guys Alex James talks about using stub entities to stub-out/fake relationships. The context in which this is discussed is for updates/inserts/deletes. I need to be able to do the same thing for a fetch. I want to be able to fetch some objects and have the foreign key reference objects be stub entities. How could I do this. Cheers ...

Entity Framework Many-To-Many with additional field on Joining Table

I have an entity context that includes three tables (see diagram here). The first is a table that contain products, the second contains recipes. The joining table has fields for IDs in both the products and recipes table as well as a 'bit' field called 'featured'. I've searched and found no example on how to insert only how to select a...

Is it easier to go from LinqToSQL to EF4.0 or EF3.5 to EF4.0?

Now that Entity Framework 4.0 is coming out I was wondering, if you were planning to use EF 4.0 when it is released would it be easier to go from LinqToSQL to EF 4.0 or EF 3.5 to 4.0? In other words if you were starting a project now anticipating using EF4.0 would you use LinqToSQL or EF3.5 now? ...

Entity Framework, Many To Many, Detached and Stub Entities

Hi guys I'm faced with my first real practical usage of a many-to-many relationship and am having a little bit of trouble with the approach... I'm using ASP.Net MVC and have the following 2 entities: Activity <---> Program. Now I was wondering what people think of the approach and if there is a better way of doing this: When pull o...

Entity Framework transaction model

Hello, I would like to know if it is possible to use another transaction system in EF that it is not System.Transaction. Could I use an abstraction of the system.transaction in it? Regards. ...

How to map base entity properties in Entity Framework?

I am setting up an entity model where I have a common base entity for most of the other entities. For example: Person -> BaseEntity BaseEntity Id Created etc... Person FirstName LastName ect... In the corresponding storage table all the columns are in the Person table. Person Id Created FirstName LastName etc... When I go to map th...

Storedprocedure from Entity Context Object

Hi, I have created the stored procedure and mapped the function. Still I can not access function for the contextobject. Any idea? ( I did search on solution but string found only in .edmx XML) ...

WCF Service invalid with Silverlight

I'm trying to get WCF working with Silverlight. I'm a total beginner to WCF but have written asmx services in the past. For some reason when I uncomment more than one method in my service Silverlight refuses to let me use it, saying it is invalid. My code is below if anyone could help. I'm using the Entity Framework if that makes a diffe...

Strange .Where() behaviour. Somebody has an explanation?

Original I don't get why the Where() clause doesn't give me the right results in the last example. It isn't any different is it? Why does C# behaves differently? transactions = IEnumerable<Transaction> //pseudocode //This works: It gives me the transaction I need. DateTime startDate = DateTime.Parse(parameter.Constraint); transactio...