DataType refactoring

This commit is contained in:
Stephan
2018-01-15 17:32:45 +01:00
parent 2f7f22961b
commit e30d8f79ef
62 changed files with 516 additions and 926 deletions

View File

@@ -27,7 +27,7 @@ namespace Umbraco.Web.Models.Mapping
propertyDto.Label = originalProperty.PropertyType.Name;
//TODO: We should be able to look both of these up at the same time!
propertyDto.DataType = dataTypeService.GetDataTypeDefinitionById(originalProperty.PropertyType.DataTypeDefinitionId);
propertyDto.DataType = dataTypeService.GetDataType(originalProperty.PropertyType.DataTypeDefinitionId);
propertyDto.PreValues = dataTypeService.GetPreValuesCollectionByDataTypeId(originalProperty.PropertyType.DataTypeDefinitionId);
return propertyDto;

View File

@@ -127,7 +127,7 @@ namespace Umbraco.Web.Models.Mapping
if (string.IsNullOrEmpty(source.Name) == false)
{
var name = Constants.Conventions.DataTypes.ListViewPrefix + source.Name;
if (_dataTypeService.GetDataTypeDefinitionByName(name) != null)
if (_dataTypeService.GetDataType(name) != null)
dest.ListViewEditorName = name;
}
});
@@ -152,7 +152,7 @@ namespace Umbraco.Web.Models.Mapping
if (string.IsNullOrEmpty(source.Alias) == false)
{
var name = Constants.Conventions.DataTypes.ListViewPrefix + source.Alias;
if (_dataTypeService.GetDataTypeDefinitionByName(name) != null)
if (_dataTypeService.GetDataType(name) != null)
dest.ListViewEditorName = name;
}
@@ -172,7 +172,7 @@ namespace Umbraco.Web.Models.Mapping
.ConstructUsing(propertyTypeBasic =>
{
var dataType = _dataTypeService.GetDataTypeDefinitionById(propertyTypeBasic.DataTypeId);
var dataType = _dataTypeService.GetDataType(propertyTypeBasic.DataTypeId);
if (dataType == null) throw new NullReferenceException("No data type found with id " + propertyTypeBasic.DataTypeId);
return new PropertyType(dataType, propertyTypeBasic.Alias);
})

View File

@@ -140,8 +140,8 @@ namespace Umbraco.Web.Models.Mapping
}
//first try to get the custom one if there is one
var dt = dataTypeService.GetDataTypeDefinitionByName(customDtdName)
?? dataTypeService.GetDataTypeDefinitionById(dtdId);
var dt = dataTypeService.GetDataType(customDtdName)
?? dataTypeService.GetDataType(dtdId);
if (dt == null)
{