Works on: U4-1979 Some legacy business logic APIs do not wrap the new Service APIs. Deprecates the ctor passing in a parent id for the data type (since it's always -1). Wraps legacy DataTypeDefinition to use the new services layer.

This commit is contained in:
Shannon
2015-05-18 16:06:22 +10:00
parent 1d0b5f3251
commit 76a10fc776
11 changed files with 104 additions and 190 deletions

View File

@@ -59,7 +59,7 @@ namespace Umbraco.Web.Models.Mapping
});
config.CreateMap<DataTypeSave, IDataTypeDefinition>()
.ConstructUsing(save => new DataTypeDefinition(-1, save.SelectedEditor) {CreateDate = DateTime.Now})
.ConstructUsing(save => new DataTypeDefinition(save.SelectedEditor) {CreateDate = DateTime.Now})
.ForMember(definition => definition.Id, expression => expression.MapFrom(save => Convert.ToInt32(save.Id)))
//we have to ignore the Key otherwise this will reset the UniqueId field which should never change!
// http://issues.umbraco.org/issue/U4-3911