internal static EntityDescriptor RestoreState(EntityDescriptorState state) { SaveStreamState saveStreamState = state.SaveStream; DataServiceContext.DataServiceSaveStream saveStream = (saveStreamState != null) ? DataServiceContext.DataServiceSaveStream.RestoreState(saveStreamState) : null; var entityDescriptor = new EntityDescriptor( state.Identity, state.SelfLink, state.EditLink, state.Entity, null, null, state.EntitySetName, state.Etag, state.State) { editMediaLink = state.EditMediaLink, readStreamLink = state.ReadStreamLink, saveStream = saveStream, selfLink = state.SelfLink, serverTypeName = state.ServerTypeName, streamETag = state.StreamETag, streamState = state.StreamState, }; entityDescriptor.RestoreState((DescriptorState)state); return(entityDescriptor); }
internal void CloseSaveStream() { if (this.saveStream != null) { DataServiceContext.DataServiceSaveStream stream = this.saveStream; this.saveStream = null; stream.Close(); } }