make static and update calling methods
This commit is contained in:
@@ -4,11 +4,11 @@ using Umbraco.Core.Persistence.Dtos;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Factories
|
||||
{
|
||||
internal class DictionaryItemFactory
|
||||
internal static class DictionaryItemFactory
|
||||
{
|
||||
#region Implementation of IEntityFactory<DictionaryItem,DictionaryDto>
|
||||
|
||||
public IDictionaryItem BuildEntity(DictionaryDto dto)
|
||||
public static IDictionaryItem BuildEntity(DictionaryDto dto)
|
||||
{
|
||||
var item = new DictionaryItem(dto.Parent, dto.Key);
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
}
|
||||
}
|
||||
|
||||
public DictionaryDto BuildDto(IDictionaryItem entity)
|
||||
public static DictionaryDto BuildDto(IDictionaryItem entity)
|
||||
{
|
||||
return new DictionaryDto
|
||||
{
|
||||
@@ -43,7 +43,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
|
||||
#endregion
|
||||
|
||||
private List<LanguageTextDto> BuildLanguageTextDtos(IDictionaryItem entity)
|
||||
private static List<LanguageTextDto> BuildLanguageTextDtos(IDictionaryItem entity)
|
||||
{
|
||||
var list = new List<LanguageTextDto>();
|
||||
foreach (var translation in entity.Translations)
|
||||
|
||||
@@ -130,9 +130,8 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
foreach (var translation in dictionaryItem.Translations)
|
||||
translation.Value = translation.Value.ToValidXmlString();
|
||||
|
||||
var factory = new DictionaryItemFactory();
|
||||
var dto = factory.BuildDto(dictionaryItem);
|
||||
|
||||
var dto = DictionaryItemFactory.BuildDto(dictionaryItem);
|
||||
|
||||
var id = Convert.ToInt32(Database.Insert(dto));
|
||||
dictionaryItem.Id = id;
|
||||
@@ -154,9 +153,8 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
foreach (var translation in entity.Translations)
|
||||
translation.Value = translation.Value.ToValidXmlString();
|
||||
|
||||
var factory = new DictionaryItemFactory();
|
||||
var dto = factory.BuildDto(entity);
|
||||
|
||||
var dto = DictionaryItemFactory.BuildDto(entity);
|
||||
|
||||
Database.Update(dto);
|
||||
|
||||
@@ -216,8 +214,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
protected IDictionaryItem ConvertFromDto(DictionaryDto dto)
|
||||
{
|
||||
var factory = new DictionaryItemFactory();
|
||||
var entity = factory.BuildEntity(dto);
|
||||
var entity = DictionaryItemFactory.BuildEntity(dto);
|
||||
|
||||
var f = new DictionaryTranslationFactory(dto.UniqueId);
|
||||
entity.Translations = dto.LanguageTextDtos.EmptyNull()
|
||||
|
||||
Reference in New Issue
Block a user