Beispiel #1
0
        public void LoadAndModifyRelated <TRelationEntity>(
            TEntity entity,
            Expression <Func <TEntity, ICollection <TRelationEntity> > > getTmmExpression,
            IEnumerable <TRelationEntity> newRelations,
            Func <TRelationEntity, TRelationEntity, bool> equalsById
            ) where TRelationEntity : class
        {
            Expression <Func <TEntity, IEnumerable <TRelationEntity> > > getRelationAsEnumerable = getTmmExpression.ContravarianceToIEnumerable();

            DbContextExtensions.LoadCollection(context, entity, getRelationAsEnumerable);
            var getTmm       = getTmmExpression.Compile();
            var oldRelations = getTmm(entity);

            ModifyRelated(
                entity, oldRelations, newRelations, equalsById
                );
        }
Beispiel #2
0
 public void LoadCollection <TRelationEntity>(TEntity entity, Expression <Func <TEntity, IEnumerable <TRelationEntity> > > getTmmExpression) where TRelationEntity : class
 {
     DbContextExtensions.LoadCollection(context, entity, getTmmExpression);
 }