Browse by Tags

All Tags » .Net (RSS)

ADO.NET Data Services Client context

One of the great points with EF is the eco-system around it. Even if it can be used without EF, I think that ADO .NET Data Services is one of the technologies in this eco-system. Indeed, using ADO.NET Data Services with EF implies almost no code to write...

Generate a WCF service from an edmx with T4 v2

I recently published a T4 template to generate a WCF service . I updated it to be able to load its relationships from an entity . When the template is written (what I’ve already done), it generates the WCF service for us (you just have to set the...

dynamic and indexer

Remember one year ago, I wrote a post on how to use reflection with dynamic keyword . At this moment, I sent an email to MS to add an indexer in dynamic. I don’t know if my email changed any thing but I am very happy to see that from .NET 4.0 Beta 2,...
Posted by Matthieu MEZIL | with no comments
Filed under: ,

Entity Framework: the productivity way

One of the best points with Entity Framework is the developer productivity gain. If you associate EF with the T4 template code generation, this gain explodes. Imagine that we want a WCF service which exposes some data. For each entity type, you probably...

EF: Include with where clause

Several guys ask me if it’s possible to add a condition in the Include method and the answer is no. However you can do an equivalent like this: from cWithP in     ( from c in context.Categories      select new     ...

I need you!

I submitted one Birds of Feather session for the next Tech Ed in Berlin. My session submission depends on your votes . I think that you will find by yourselves which is my session Thanks by advance for your votes

ADO.NET EntityObject Generator: how to get the EntityType’s EntitySet and how to get EntitySet’s EntityTypes?

One of my customers wanted to know how to get all EntityTypes for an EntitySet in his T4 template based on the MS ADO.NET EntityObject Generator one. So I made a POC for him. What do I do? I change two classes included in the template (my changes are...

PFx is good

I am sure that the Parallel Framework (PFx) will take more and more importance in future developments. However, demos often are not in phase with the reality. It’s true that a fractal demo on a 1000 cores machine is ideal for parallel demo, however in...

How to get the typed instance in the abstract class?

Alex James , PM on EF, publish sometimes some C# posts . He published a post to explain how to “link” the methods call . To realize it, he returns the instance in his methods: public abstract class PropertyConfiguration { private bool _nullable;...
Posted by Matthieu MEZIL | with no comments
Filed under: ,

How to have FK in EF v1?

Before answering this question, I will start with another one: why do we need FK? to be able to change a relationship without loading the related entity but we can already do it with the EntityReference property. for the binding With the windows forms...
Posted by Matthieu MEZIL | with no comments

T4 for View Generation

EF team blogged about it here and I think that it’s very useful. First, I think that it’s easier to use than Edmgen. Moreover, contrary to EdmGen, it allows you to use embedded metadata artifacts. If you want to use the MS T4 template with...
Posted by Matthieu MEZIL | with no comments

POCO T4

With EF4 features CTP1, we have a great POCO template which is divided in two tt files to allow us to have the entitiy POCO classes and the context in different projects. It’s very very cool. However, I think that it’s a shame not to have...
Posted by Matthieu MEZIL | with no comments

SubObjectSet

With EF, when you use TPH or TPC inheritance mapping scenarii, the EntitySet is on the base class. As I mentioned often in the past with EF v1, you can add a property in your context which returns the EntitySet.OfType<MySubType>(). Ok it’s...
Posted by Matthieu MEZIL | with no comments

Entity Framework v2: How to get only one entity easier with EF4

Alex James wrote an extension method which allows to get only one entity from a query and the entity key . If we have the key, I think it’s useless to allow it for all queries and it’s useful only for EntitySet. With EF4, this extension method...

Entity Framework: Undo Redo v2

After my first Undo Redo POC version , one of my customers wanted to be able to manage many actions per Undo / Redo. So I added two extension methods: BeginGroupOfUndoActions and EndGroupOfUndoActions. My code is now this one: public static class ObjectContextExtension...

EF : Undo Redo

How to use Undo/Redo with EntityFramework? This isn’t managed by EF. So we will have to do it ourselves. We could clone the entities and group them into a Stack but in this case I worry about my memory usage growing too much. So I prefer another...

How to split your EDM v2?

After my previous post about it , my customer asks me the following question: how to get a complete graph (with categories, suppliers, products, order details, orders, customers and employees)? To realize it, we have to add “sort of” navigation...

ValidateOnBuild

The VS 2008 SP1 EDM designer doesn’t support all the mapping scenarii: Complex Types (supported with VS 2010 Beta 1) TPC Horizontal Entity Splitting I know another (free) designer which does . The most irritating thing with VS 2008 EDM designer (it isn...

How to split your EDM?

One of my customers wants to code an ERP. To make it, he wants to use EF. His DB has more than 600 tables with a lot of relationships between all of them. The problem is the fact that Entity Framework has some difficulties with big models. You should...

EF4 POCO: my tests

I published an unit tests project to show how POCO works with EF4 . I also wrote a BetaBugs test class in order to illustrate the POCO implementation Beta bugs.
Posted by Matthieu MEZIL | with no comments
More Posts Next page »