Ejemplo n.º 1
0
        public virtual void SaveModel(TModel model)
        {
            IDbContextReflector     reflector        = new DbContextReflector(DbContext, "RecordLabel.Data.Models", "ReleaseData");
            IEntityUpdater          scalarUpdater    = new ScalarPropertyUpdater(DbContext, reflector);
            EntityComparerByKeys    entityComparer   = new EntityComparerByNonForeignKeys();
            ICollectionMerger       collectionMerger = new CollectionMerger(entityComparer);
            IRecursiveEntityUpdater updater          = new EntityUpdater(DbContext, reflector, scalarUpdater, collectionMerger);
            IRecursiveEntityUpdater navUpdater       = new NavigationPropertyUpdater(DbContext, scalarUpdater, reflector);

            updater.UpdateEntity <TModel>(model, navUpdater);
        }
Ejemplo n.º 2
0
        public void UpdateEntityNullEntityThrows()
        {
            Func <UpdateEntityResult <Entity> > func = () => _sut.UpdateEntity((Entity)null, NotValidJson, new EntityUpdateRequest());

            func.Should().Throw <ArgumentNullException>();
        }