Exemplo n.º 1
0
        public virtual TEntity Load(Expression <Func <TEntity, bool> > predicate, params Expression <Func <TEntity, object> >[] expanders)
        {
            DataServiceQuery <TEntity> query = Context.CreateQuery <TEntity>(EntitySetName);

            query = query.Expand(expanders);

            IQueryable <TEntity> queryable = query.Where(predicate);

            TEntity existing = query.SingleOrDefault();

            if (existing != null)
            {
                Entity = existing;
            }

            return(Entity);
        }