Skip to content
Daryl LaBar edited this page Apr 16, 2020 · 3 revisions

2.3.0.1

DLaB.Xrm.Test.Builders.EntityBuilder has been renamed to DLaB.Xrm.Test.Builders.DLaBBuilder and an extra generic parameter has been added.

Why? The extra parameter was added to allow any base implementation to return the most derived class type in fluent methods. Since this was a breaking change, it made sense to rename it as well so that any class inheriting it with the name EntityBuilder won't require a namespace to avoid name collisions.

Steps to resolve breaking changes

  1. Any class that inherits from DLaB.Xrm.Test.Builders.EntityBuilder will now need to be updated to inherit from DLaB.Xrm.Test.Builders.EntityBuilder. An extra type parameter that is defined as the type of the class itself must be added as well.
  2. The TestSettings.EntityBuilder.ConfigureDerivedAssembly normally is set to the custom project specific EntityBuilder. If so, will need to be updated to a typed entity specific builder, or a new non self referencing EntityBuilder will need to be created.

Here are the before and after changes made:

EntityBuilder.cs - Or any class that would inherit from DLaB.Xrm.Test.Builders.EntityBuilder

   public abstract class EntityBuilder<TEntity> : DLaB.Xrm.Test.Builders.EntityBuilder<TEntity> where TEntity : Entity
   {

   }

ActionBuilder.cs - Or any class that would inherit from a base EntityBuilder

public class AccountBuilder : EntityBuilder<Account>
{
   ...
}

EntityBuilder.cs

    public abstract class EntityBuilder<TEntity, TBuilder> : DLaB.Xrm.Test.Builders.DLaBEntityBuilder<TEntity, TBuilder>
        where TBuilder : EntityBuilder<TEntity, TBuilder>
        where TEntity : Entity
    {

    }

    public abstract class EntityBuilder<TEntity> : EntityBuilder<TEntity, EntityBuilder<TEntity>>
        where TEntity : Entity
    {

    }

ActionBuilder.cs

public class AccountBuilder : EntityBuilder<Account, AccountBuilder>
{
   ...
}

Clone this wiki locally