private DataTypeRegistration BuildEnumRegistration(Type type) { _locks.TakeOrWait(type); DataTypeRegistration dataTypeRegistration; if (_register.TryGetRegistration(type, out dataTypeRegistration)) { _locks.Release(type); return(dataTypeRegistration); } var attr = type.GetCodeFirstAttribute <DataTypeAttribute>(); if (attr == null) { attr = new EnumDataTypeAttribute(); attr.Initialise(type); } dataTypeRegistration = new DataTypeRegistration() { ClrType = type, ConverterType = attr.ConverterType, PropertyEditorAlias = attr.PropertyEditorAlias, DataTypeInstanceName = attr.Name, UmbracoDatabaseType = attr.DbType, CodeFirstControlled = true }; _registerController.Register(type, dataTypeRegistration); _locks.Release(type); return(dataTypeRegistration); }