Implements ILocalizationService for U4-1075

Refactoring DictionaryItem, DictionaryTranslation and Language to use the same interface implementations as the rest of the db driven repos and services.
This commit is contained in:
sitereactor
2012-10-24 12:22:52 -02:00
parent da0ab7b76a
commit a9bc0addfb
18 changed files with 444 additions and 54 deletions

View File

@@ -10,32 +10,32 @@ namespace Umbraco.Core.Models
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
public class DictionaryTranslation : Entity
public class DictionaryTranslation : Entity, IDictionaryTranslation
{
private Language _language;
private ILanguage _language;
private string _value;
public DictionaryTranslation(Language language, string value)
public DictionaryTranslation(ILanguage language, string value)
{
_language = language;
_value = value;
}
public DictionaryTranslation(Language language, string value, Guid uniqueId)
public DictionaryTranslation(ILanguage language, string value, Guid uniqueId)
{
_language = language;
_value = value;
Key = uniqueId;
}
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, Language>(x => x.Language);
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, ILanguage>(x => x.Language);
private static readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, string>(x => x.Value);
/// <summary>
/// Gets or sets the <see cref="Language"/> for the translation
/// </summary>
[DataMember]
public Language Language
public ILanguage Language
{
get { return _language; }
set