locked
ModelBuilder low performance? RRS feed

  • Question

  • Having this code in OnModelCreating event really slows down visual studio, once i remove it its super fast again. Can anyone confirm?

     

     Protected Overrides Sub OnModelCreating(ByVal ModelBuilder As System.Data.Entity.ModelConfiguration.ModelBuilder)
    
        Dim Decimals = {ModelBuilder.Entity(Of Material).Property(Function(Prop) Prop.Quantity),
                 ModelBuilder.Entity(Of ProductPrice).Property(Function(Prop) Prop.Price),
                 ModelBuilder.Entity(Of ProductQuantity).Property(Function(Prop) Prop.Quantity),
                 ModelBuilder.Entity(Of Product).Property(Function(Prop) Prop.TaxRate),
                 ModelBuilder.Entity(Of Product).Property(Function(Prop) Prop.PUomFrom),
                 ModelBuilder.Entity(Of Product).Property(Function(Prop) Prop.PUomTo),
                 ModelBuilder.Entity(Of Product).Property(Function(Prop) Prop.SUomFrom),
                 ModelBuilder.Entity(Of Product).Property(Function(Prop) Prop.SUomTo),
                 ModelBuilder.Entity(Of PurchaseOrderItem).Property(Function(Prop) Prop.Discount),
                 ModelBuilder.Entity(Of PurchaseOrderItem).Property(Function(Prop) Prop.Price),
                 ModelBuilder.Entity(Of PurchaseOrderItem).Property(Function(Prop) Prop.Quantity),
                 ModelBuilder.Entity(Of PurchaseOrderItem).Property(Function(Prop) Prop.Subtotal),
                 ModelBuilder.Entity(Of PurchaseOrderItem).Property(Function(Prop) Prop.TaxRate)}
    
        Decimals.ToList().ForEach(Sub(DecimalProp)
                       DecimalProp.Precision = 18
                       DecimalProp.Scale = 4
                     End Sub)
      End Sub
    


    VB.NET to C# http://www.developerfusion.com/tools/convert/vb-to-csharp/
    Tuesday, October 26, 2010 7:01 AM

Answers

  • Hi,

    Because CTP4 is only intended as a preview to get feedback on proposed features (and not licensed for production use) we haven't done any performance tuning on it yet. ModelBuilder definitely has some performance issues and is something we will focus on as we progress to RTM quality.

    ~Rowan

    Sunday, October 31, 2010 3:42 AM
    Moderator