English
, en-US
, or en-GB
.
es-ES
for Spanish.// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Delivery;
// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.Build();
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Gets a specific article in Spanish
IDeliveryItemResponse<Article> response = await client.GetItemAsync<Article>("about_us",
new LanguageParameter("es-ES")
);
Article item = response.Item;
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Delivery;
// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7")
.Build();
// Tip: Create strongly typed models according to https://kontent.ai/learn/net-strong-types
// Filters all articles to find the Spanish variant by its URL slug
IDeliveryItemListingResponse<Article> response = await client.GetItemsAsync<Article>(
new LanguageParameter("es-ES"),
new EqualsFilter("system.type", "article"),
new EqualsFilter("elements.url_pattern", "acerda-de-nosotros")
);
IList<Article> items = response.Items;
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Delivery;
// Tip: Use DI to create Delivery client https://kontent.ai/learn/net-register-client
IDeliveryClient client = DeliveryClientBuilder
.WithProjectId("975bf280-fd91-488c-994c-2f04416e5ee3")
.Build();
// Gets content items in Spanish without following language fallbacks
IDeliveryItemListingResponse<object> response = await
client.GetItemsAsync<object>(
new LanguageParameter("es-ES"),
new EqualsFilter("system.language", "es-ES")
);
IList<object> items = response.Items;