Exemple #1
0
 public static void Replace <TEntity, TUpdate>(this DbContext db,
                                               IEnumerable <TEntity> saved, IEnumerable <TUpdate> rest, Action <TEntity, TUpdate> additionalAction = null)
     where TEntity : class
     where TUpdate : class
 {
     Update(db, saved, rest, () => ComparerHelper.CompareSimple(saved, rest), additionalAction);
 }
Exemple #2
0
        public static void UpdateSingle <TEntity, TUpdate>(this DbContext db,
                                                           TEntity saved, TUpdate rest, Action <TEntity, TUpdate> additionalAction = null)
            where TEntity : class, IGuid
            where TUpdate : class, IGuid
        {
            var savedArray = saved == null ? null : new[] { saved };
            var restArray  = rest == null ? null : new[] { rest };

            Update(db, savedArray, restArray, () => ComparerHelper.CompareSimple(savedArray, restArray), additionalAction);
        }