/// <summary> /// Instantiates the class using default components /// </summary> /// <param name="dbContext">Context in which to perform the merge operation</param> /// <param name="modelsNamespace">Namespace in which all context entities are defined (all models must be within /// the same namespace. If model type is in a different namespace, an exception will be thrown when instantiating /// the type. This is, hopefully, a temporary workaround, until I find a good solution for this)</param> /// <param name="modelAssemblyName">Name of assembly which contains all context enties. Again, just like with the /// namespace parameter, this is a temporary workaround</param> public DefaultEntityChangesMerger(DbContext dbContext, string modelsNamespace, string modelAssemblyName) { DbContext = dbContext; reflector = new DbContextReflector(DbContext, modelsNamespace, modelAssemblyName); scalarUpdater = new ScalarPropertyUpdater(DbContext, reflector); entityComparer = new EntityComparerByNonForeignKeys(); collectionMerger = new CollectionMerger(entityComparer); navUpdater = new NavigationPropertyUpdater(DbContext, scalarUpdater, reflector); }
public CollectionMerger(IEntityComparerByKeys entityComparer) { EntityComparer = entityComparer; }