DataType refactoring
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user