-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mark the IRelewisePropertyConverter as public, thus exposing it… (
#32) * feat: mark the IRelewisePropertyConverter as public, thus exposing it to the DI container * update minor version according to SemVer
- Loading branch information
Showing
7 changed files
with
38 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 22 additions & 4 deletions
26
src/Integrations.Umbraco/Services/IRelewisePropertyConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
using System.Collections.Generic; | ||
using System; | ||
using System.Collections.Generic; | ||
using Relewise.Client.DataTypes; | ||
using Umbraco.Cms.Core.Models.PublishedContent; | ||
|
||
namespace Relewise.Integrations.Umbraco.Services; | ||
|
||
internal interface IRelewisePropertyConverter | ||
/// <summary> | ||
/// Converts a collection of published properties to a dictionary of data values, supporting multiple cultures. | ||
/// </summary> | ||
public interface IRelewisePropertyConverter | ||
{ | ||
Dictionary<string, DataValue?> Convert(IEnumerable<IPublishedProperty> properties, string[] cultures); | ||
/// <summary> | ||
/// Converts the given collection of properties to a read-only dictionary of data values. | ||
/// The conversion supports multiple cultures. | ||
/// </summary> | ||
/// <param name="properties">A collection of published properties to be converted.</param> | ||
/// <param name="cultures">An array of culture codes to consider during conversion.</param> | ||
/// <returns>A read-only dictionary where keys are property names and values are data values.</returns> | ||
IReadOnlyDictionary<string, DataValue?> Convert(IEnumerable<IPublishedProperty> properties, string[] cultures); | ||
|
||
public Dictionary<string, DataValue?> Convert(IEnumerable<IPublishedProperty> properties, string culture) => Convert(properties, new[] { culture }); | ||
/// <summary> | ||
/// Converts the given collection of properties to a read-only dictionary of data values. | ||
/// The conversion supports multiple cultures. | ||
/// </summary> | ||
/// <param name="properties">A collection of published properties to be converted.</param> | ||
/// <param name="culture">The culture code for which the property should be converted.</param> | ||
/// <returns>A read-only dictionary where keys are property names and values are data values.</returns> | ||
public IReadOnlyDictionary<string, DataValue?> Convert(IEnumerable<IPublishedProperty> properties, string culture) => Convert(properties, [culture]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters