SenseNet / sensenet

Open Source Content Services Platform written in .NET
https://sensenet.com
GNU General Public License v2.0
173 stars 112 forks source link

Getting global metadata #1896

Open kavics opened 1 year ago

kavics commented 1 year ago

Create an API that can access the global metadata according to the OData standard. Examples of the standard requests:

OData.svc/$metadata
OData.svc/Root/Content/IT/Document_Library/$metadata

Possible examples for the new API:

public Task<string> GetMetadataAsync(CancellationToken cancel);                                     // xml
public Task<string> GetMetadataAsync(ResponseFormat format, CancellationToken cancel);              // json or xml
public Task<string> GetMetadataAsync(string path, CancellationToken cancel);                        // xml
public Task<string> GetMetadataAsync(string path, ResponseFormat format, CancellationToken cancel); // json or xml

or

public Task<string> GetMetadataAsync(CancellationToken cancel, string path = null, ResponseFormat? format = null );

This API is complete if the return value is a predefined schema object instead of a string (even a copy of Edmx on the server side).