Search

You searched for the word(s): userid:3357
Page 1 of 20 (198 items) 1 2 3 4 5 Next > ... Last »
  • 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, we are now able to use it. So in my sample, instead of result = dynamicSpBase.get_Item(name); I can now directly write this: result = dynamicSpBase[name]; Great!
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Wed, Oct 21 2009
    Filed under: .Net, C#
  • 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      {          Category = c,          Products = from p in c.Products                    
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Wed, Oct 7 2009
    Filed under: .Net, Entity Framework (EF), Entity Data Model (EDM)
  • 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
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Sat, Sep 26 2009
    Filed under: .Net, Entity Framework (EF), Entity Data Model (EDM), Tech Ed
  • 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 in bold): private class EntitySetObjectSetPropertyWrapper : MetadataItemWrapper { public EntitySetObjectSetPropertyWrapper( EntitySet entitySet, WrapperBase wrapper) : base (entitySet, wrapper) { } public new EntitySet Source { get { return ( EntitySet
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Wed, Sep 2 2009
    Filed under: .Net, Entity Framework (EF), Entity Data Model (EDM), T4
  • 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 real life, I never used the fractal yet and I don’t think that I am the only one in this case. So my idea was to make an example inspired from my daily work. So I made an example around… the Entity Framework. Imagine a DB featuring a Customers table
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Tue, Sep 1 2009
    Filed under: .Net, C#, Entity Framework (EF), Parallel Framework (PFx)
  • 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; public virtual PropertyConfiguration Nullable() { _nullable = true ; return this ; } public virtual PropertyConfiguration NonNullable() { _nullable = false ; return this ; } } public class StringPropertyConfiguration : PropertyConfiguration {
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Mon, Aug 3 2009
    Filed under: .Net, C#
  • 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 ComboBox, we don’t need it because you don’t have to systematically set the ValueMember property: categoriesComboBox.DataSource = context.Categories; categoriesComboBox.DisplayMember = "CategoryName" ; categoriesComboBox.DataBindings.Add(
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Tue, Jul 21 2009
    Filed under: .Net, C#, Entity Framework (EF), T4
  • 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 VS 2010, don’t forget to change the xml namespaces. XNamespace edmxns = "http://schemas.microsoft.com/ado/2008/10/edmx"; XNamespace csdlns = "http://schemas.microsoft.com/ado/2008/09/edm"; XNamespace mslns = "http://schemas
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Mon, Jun 29 2009
    Filed under: .Net, Entity Framework (EF), T4
  • 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 an interface for the context particularly to mock it. So I change the .Context.tt like this: <#@ template language="C#" debug="false" hostspecific="true"#> <#@ include file="EF.Utility.ctp.CS.ttinclude"#><#
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Fri, Jun 26 2009
    Filed under: .Net, Entity Framework (EF), T4, TDD
  • 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 interesting but… In EF v1, the EntitySet is an ObjectQuery<T> property and our property also but in EF v2 the EntitySet is an ObjectSet<T>. This class implements the IObjectSet<T> interface which has three methods to add, attach
    Posted to Matthieu MEZIL (Weblog) by Matthieu MEZIL on Tue, Jun 16 2009
    Filed under: .Net, Entity Framework (EF)
Page 1 of 20 (198 items) 1 2 3 4 5 Next > ... Last »