Preview a server-generated Net Operation Project source template without creating a revision.
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/admin/net-operation-project/source-templates/preview"), Content = new StringContent("{ \"TemplateId\": \"example\", \"ClassName\": \"example\", \"DisplayName\": \"example\", \"StableKey\": \"example\", \"TargetEntityDefinitionId\": \"example\", \"Folder\": \"example\", \"Path\": \"example\", \"RevisionId\": \"example\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://example.com/api/workspace/admin/net-operation-project/source-templates/preview';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"TemplateId":"example","ClassName":"example","DisplayName":"example","StableKey":"example","TargetEntityDefinitionId":"example","Folder":"example","Path":"example","RevisionId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/workspace/admin/net-operation-project/source-templates/preview \ --header 'Content-Type: application/json' \ --data '{ "TemplateId": "example", "ClassName": "example", "DisplayName": "example", "StableKey": "example", "TargetEntityDefinitionId": "example", "Folder": "example", "Path": "example", "RevisionId": "example" }'Authorizations
Section titled “Authorizations”- None
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.
Request Body
Section titled “Request Body”Request a generated Net Operation Project source template preview.
object
Template identifier.
Requested C# class name.
Optional user-facing function or data-source display name.
Optional stable function or data-source key.
Optional target Entity Definition id for entity-scoped templates.
Optional source folder used when Path is omitted.
Optional explicit source path.
Optional source revision id used for collision warnings.
Examplegenerated
{ "TemplateId": "example", "ClassName": "example", "DisplayName": "example", "StableKey": "example", "TargetEntityDefinitionId": "example", "Folder": "example", "Path": "example", "RevisionId": "example"}Request a generated Net Operation Project source template preview.
object
Template identifier.
Requested C# class name.
Optional user-facing function or data-source display name.
Optional stable function or data-source key.
Optional target Entity Definition id for entity-scoped templates.
Optional source folder used when Path is omitted.
Optional explicit source path.
Optional source revision id used for collision warnings.
Examplegenerated
{ "TemplateId": "example", "ClassName": "example", "DisplayName": "example", "StableKey": "example", "TargetEntityDefinitionId": "example", "Folder": "example", "Path": "example", "RevisionId": "example"}Request a generated Net Operation Project source template preview.
object
Template identifier.
Requested C# class name.
Optional user-facing function or data-source display name.
Optional stable function or data-source key.
Optional target Entity Definition id for entity-scoped templates.
Optional source folder used when Path is omitted.
Optional explicit source path.
Optional source revision id used for collision warnings.
Examplegenerated
{ "TemplateId": "example", "ClassName": "example", "DisplayName": "example", "StableKey": "example", "TargetEntityDefinitionId": "example", "Folder": "example", "Path": "example", "RevisionId": "example"}Responses
Section titled “Responses”OK
object
Generated Net Operation Project source template preview.
object
Template identifier.
Normalized source path for the generated file.
Generated C# source content.
Sanitized C# class name.
Resolved display name used by the template.
Resolved stable key used by the template.
Resolved target Entity Definition id, when applicable.
Generated workspace contract CLR type for the target entity, when applicable.
Non-blocking preview warnings.
object
object
object
object
Example
{ "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Bad Request
object
Generated Net Operation Project source template preview.
object
Template identifier.
Normalized source path for the generated file.
Generated C# source content.
Sanitized C# class name.
Resolved display name used by the template.
Resolved stable key used by the template.
Resolved target Entity Definition id, when applicable.
Generated workspace contract CLR type for the target entity, when applicable.
Non-blocking preview warnings.
object
object
object
object
Example
{ "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Generated Net Operation Project source template preview.
object
Template identifier.
Normalized source path for the generated file.
Generated C# source content.
Sanitized C# class name.
Resolved display name used by the template.
Resolved stable key used by the template.
Resolved target Entity Definition id, when applicable.
Generated workspace contract CLR type for the target entity, when applicable.
Non-blocking preview warnings.
object
object
object
object
Example
{ "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}