public void Process(string fullPath, SegmentOp operation, ODataModel model, string contentType = "application/atom+xml", string accept = "application/atom+xml", Stream inputStream = null) { _body = new StringBuilder(); var segments = SegmentParser.parse(fullPath, String.Empty, model); _response = new ResponseParameters(null, Encoding.UTF8, new StringWriter(_body), 200); var callbacks = new ProcessorCallbacks( (rt, item) => { _accessSingle.Add(new Tuple <ResourceType, object>(rt, item)); return(true); }, (rt, items) => { _accessMany.Add(new Tuple <ResourceType, IEnumerable>(rt, items)); return(true); }, (rt, item) => { _created.Add(new Tuple <ResourceType, object>(rt, item)); return(true); }, (rt, item) => { _updated.Add(new Tuple <ResourceType, object>(rt, item)); return(true); }, (rt, item) => { _removed.Add(new Tuple <ResourceType, object>(rt, item)); return(true); } ); SegmentProcessor.Process(operation, segments, callbacks, new RequestParameters( model, model as IDataServiceMetadataProvider, new DataServiceMetadataProviderWrapper(model), contentType, Encoding.UTF8, inputStream, new Uri("http://localhost/base/"), new [] { accept } ), _response ); }
public void Process(string fullPath, SegmentOp operation, ODataModel model, string contentType = "application/atom+xml", string accept = "application/atom+xml", Stream inputStream = null) { _body = new StringBuilder(); var segments = SegmentParser.parse(fullPath, String.Empty, model); _response = new ResponseParameters(null, Encoding.UTF8, new StringWriter(_body), 200); var callbacks = new ProcessorCallbacks( (rt, item) => { _accessSingle.Add(new Tuple<ResourceType, object>(rt, item)); return true; }, (rt, items) => { _accessMany.Add(new Tuple<ResourceType, IEnumerable>(rt, items)); return true; }, (rt, item) => { _created.Add(new Tuple<ResourceType, object>(rt, item)); return true; }, (rt, item) => { _updated.Add(new Tuple<ResourceType, object>(rt, item)); return true; }, (rt, item) => { _removed.Add(new Tuple<ResourceType, object>(rt, item)); return true; } ); SegmentProcessor.Process(operation, segments, callbacks, new RequestParameters( model, model as IDataServiceMetadataProvider, new DataServiceMetadataProviderWrapper(model), contentType, Encoding.UTF8, inputStream, new Uri("http://localhost/base/"), new [] { accept } ), _response ); }