Exemplo n.º 1
0
        public virtual T GetByKeys(IQueryable <T> preFilter = null, params object[] keys)
        {
            EntityHelper.ConvertKeyValues <T>(keys);
            var item = this.DbSet.Find(keys);

            if (preFilter == null || preFilter.Contains(item))
            {
                return(item);
            }

            return(null);
        }
Exemplo n.º 2
0
        public virtual async Task <T> GetByKeysAsync(IQueryable <T> preFilter, params object[] keys)
        {
            EntityHelper.ConvertKeyValues <T>(keys);
            var item = await this.DbSet.FindAsync(keys);

            if (preFilter != null && !preFilter.Contains(item))
            {
                return(null);
            }
            else
            {
                return(item);
            }
        }