예제 #1
0
        public static BindingCollection <TEntity> DiffTwoListAndGetDel <TEntity>(EntityList <TEntity> before, EntityList <TEntity> after) where TEntity : EntityBase <TEntity>
        {
            BindingCollection <TEntity> result = new BindingCollection <TEntity>();

            if ((before != null) && (after == null))
            {
                result = before.Entities;
            }
            else if ((before != null) && (after != null))
            {
                result = new BindingCollection <TEntity>(before.Entities.Except(after.Entities, new EntityIdComparer <TEntity>()).ToList <TEntity>());
            }

            return(result);
        }
예제 #2
0
        public static BindingCollection <TEntity> DiffTwoListAndGetUpd <TEntity>(EntityList <TEntity> before, EntityList <TEntity> after) where TEntity : EntityBase <TEntity>
        {
            BindingCollection <TEntity> result = new BindingCollection <TEntity>();

            if ((before != null) && (after != null))
            {
                foreach (TEntity entity in after.Entities.Except(before.Entities, new EntityFullComparer <TEntity>()))
                {
                    if (!entity.IsNewEntity)
                    {
                        result.Add(entity);
                    }
                }
            }
            return(result);
        }