public bool Contains(TEntity entity)
        {
            bool contains = false;

            if (entity.State == EntityState.New)
            {
                contains = Collection.Any(e => !e.IsDeleted && e.Guid.Equals(entity.Guid));
            }
            else
            {
                contains = Collection.Any(e => !e.IsDeleted && DbEntityUtilities.PrimaryKeysEqual(e.PrimaryKeys, entity.PrimaryKeys));
            }
            return(contains);
        }
 public TEntity Get(Tuple <string, object>[] primaryKeys)
 {
     return(Collection.SingleOrDefault(e => /*!e.IsDeleted && */ DbEntityUtilities.PrimaryKeysEqual(e.PrimaryKeys, primaryKeys)));
 }