一键导入
contentstack-management-dotnet-sdk
Use when changing or using the CMA client API, authentication, or NuGet package surface for Contentstack.Management.Core.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when changing or using the CMA client API, authentication, or NuGet package surface for Contentstack.Management.Core.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when reviewing or preparing a pull request for contentstack-management-dotnet.
Use for branches, CI, build/test scripts, and NuGet release flow in contentstack-management-dotnet.
Use for the contentstack.management.aspnetcore package, HttpClient/DI registration with ASP.NET Core.
Use for C# language level, nullable usage, and file/folder layout consistent with Contentstack.Management.Core.
Use when building or updating DocFX API documentation under docfx_project for this repository.
Use for target frameworks, assembly signing, NuGet packaging, OS-specific builds, and HTTP pipeline overview in Contentstack.Management.Core.
| name | contentstack-management-dotnet-sdk |
| description | Use when changing or using the CMA client API, authentication, or NuGet package surface for Contentstack.Management.Core. |
ContentstackClient behavior, options, or service entry points.contentstack.management.csharp.Official API reference: Content Management API.
| Package ID | Project | Role |
|---|---|---|
contentstack.management.csharp | Contentstack.Management.Core/ | Main SDK; ContentstackClient, models, services. |
contentstack.management.aspnetcore | Contentstack.Management.ASPNETCore/ | ASP.NET Core registration helpers; see ../aspnetcore-integration/SKILL.md. |
ContentstackClient (IContentstackClient).ContentstackClientOptions (and related options types).client.Stack(apiKey, managementToken) per product docs.ContentstackClient.Login / LoginAsync with NetworkCredential (see root README.md examples).OAuth-related code lives under Services/OAuth/, OAuthHandler.cs, and Utils/PkceHelper.cs. Prefer small, testable changes; preserve existing public contracts unless doing a major version bump.
ContentstackClient (e.g. custom JsonConverter types for fields and nodes).Models/. Follow existing patterns when adding types.Exceptions/. Keep messages and HTTP status handling consistent with existing patterns.../http-pipeline/SKILL.md. TFMs and packaging: ../framework/SKILL.md.This describes how requests flow through this SDK. It is not the Content Delivery (CDA) client: there is no HttpWebRequest-only layer or delivery-token query-string-only rule set here.
ContentstackClient (ContentstackClient.cs) is the public entry point.ContentstackClientOptions (ContentstackClientOptions.cs) holds Host, tokens, proxy, retry settings, and optional custom RetryPolicy.ContentstackRuntimePipeline in BuildPipeline(): HttpHandler → RetryHandler (see ../http-pipeline/SKILL.md).Stack (Models/Stack.cs) is obtained from the client (e.g. client.Stack(apiKey, managementToken) or overloads). Most management operations are stack-relative.Models/ (entries, assets, content types, etc.) expose methods that construct or call IContentstackService implementations.IContentstackService (Services/IContentstackService.cs) defines one CMA operation: resource path, HTTP method, headers, query/path resources, body (HttpContent), and hooks to build the outbound request and handle the response.InvokeSync / InvokeAsync, which run the pipeline and return ContentstackResponse.Important members on IContentstackService:
Parameters — ParameterCollection for typed query/body parameters (used by list/query flows).QueryResources, PathResources, AddQueryResource, AddPathResource — URL composition.UseQueryString — some operations send parameters as query string instead of body.CreateHttpRequest / OnResponse — integrate with ContentstackHttpRequest and response parsing.Concrete services live under Services/ (including nested folders by domain, e.g. stack, organization, OAuth).
Implementation details span OAuthHandler, Services/OAuth/, and client token dictionaries on ContentstackClient (high-level behavior is under Authentication above).
IContentstackService (or reuse patterns from a sibling service in Services/).Stack / model type; keep public API consistent with existing naming.../http-pipeline/SKILL.md.The management SDK exposes a fluent Query type for listing resources (stacks, entries, assets, roles, etc.). It is separate from the Content Delivery SDK’s query DSL.
| Type | Location | Role |
|---|---|---|
Query | Queryable/Query.cs | Fluent methods add entries to an internal ParameterCollection, then Find / FindAsync runs QueryService. |
ParameterCollection | Queryable/ParameterCollection.cs | SortedDictionary<string, QueryParamValue> with overloads for string, double, bool, List<string>, etc. |
Models such as Entry, Asset, Role, Stack expose Query() returning a Query bound to that resource path. Chain parameters, then call Find() or FindAsync():
// Illustrative — see XML examples on Query/Stack/Entry in the codebase.
ContentstackResponse response = client
.Stack("<API_KEY>", "<MANAGEMENT_TOKEN>")
.ContentType("<CONTENT_TYPE_UID>")
.Entry()
.Query()
.Limit(10)
.Skip(0)
.Find();
Requirements enforced by Query:
ThrowIfNotLoggedIn).ThrowIfAPIKeyEmpty).FindFind(ParameterCollection collection = null) and FindAsync merge an optional ParameterCollection into the query before building QueryService. Use this when ad-hoc parameters are not exposed as fluent methods.
Query that calls _collection.Add("api_key", value) (or the appropriate ParameterCollection overload).this for chaining.<example> consistent with existing Query members.IContentstackServiceList operations ultimately construct a QueryService that implements IContentstackService and is executed through ContentstackClient.InvokeSync / InvokeAsync. Path and HTTP details live on the service; the fluent API only shapes ParameterCollection. For the overall request path, see Architecture above.