public virtual IQueryable <TModel> ApplyTo()
        {
            var wrapper = tableDataService.CreateWrapper();
            Func <IQueryable <TEntity>, IQueryable <TModel> > projectionFunc = wrapper.Project;

            return((IQueryable <TModel>)ProjectionApplyTo(wrapper.GetEntities(), projectionFunc));
        }
        public ODataTableDataServiceWrapper(TableDataService <TEntity, TModel, TIdentifier> tableDataService, ODataQuerySettings oDataQuerySettings = null)
        {
            tableServiceWrapper = tableDataService.CreateWrapper();
            ODataQuerySettings  = oDataQuerySettings ?? new ODataQuerySettings();

            ODataValidationSettings = new ODataValidationSettings()
            {
                MaxTop = ODataQuerySettings.PageSize
            };
            ODataValidationSettings.AllowedQueryOptions = AllowedQueryOptions.Filter | AllowedQueryOptions.Top | AllowedQueryOptions.Skip | AllowedQueryOptions.OrderBy;
        }
 public RangedTableDataServiceOperations(TableDataService <TEntity, TModel, TIdentifier> service)
 {
     this.service = service;
     wrapper      = service.CreateWrapper();
 }
        public async Task <IEnumerable <TModel> > AddRangeAsync(IEnumerable <TModel> models)
        {
            var imp      = TableDataServiceExtensions.GetImplementation <ICommandRangeRepository <TEntity> >(service.CreateWrapper().Repository);
            var es       = ToEntities(models, UpsertType.Insert);
            var entities = await imp.AddAsync(es);

            await wrapper.CommitAsync();

            return(ToModels(entities));
        }
Beispiel #5
0
 protected virtual IQueryable <TEntity> GetEntities()
 {
     return(tableDataService.CreateWrapper().GetEntities());
 }