Cleanup
This commit is contained in:
@@ -38,10 +38,6 @@ namespace Umbraco.Core.Models.Entities
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(value, ref _id, Ps.Value.IdSelector);
|
||||
|
||||
// fixme - this is a problem w/ user 'admin' having ID 'zero'
|
||||
// in v7 _hasIdentity becomes true soon as an ID is set, which is... weird
|
||||
// we should NOT have 'admin' have ID 'zero'
|
||||
_hasIdentity = value != 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,10 +672,16 @@ namespace Umbraco.Core
|
||||
// return o is T t ? t : (T) System.Convert.ChangeType(o, typeof(T));
|
||||
//}
|
||||
|
||||
private static MethodInfo _convertMethod;
|
||||
|
||||
private static void Convert(this ILGenerator ilgen, Type type)
|
||||
{
|
||||
ilgen.Emit(OpCodes.Ldtoken, type);
|
||||
ilgen.CallMethod(typeof(Convert).GetMethod("ChangeType", BindingFlags.Public | BindingFlags.Static, null, new[] { typeof(object), typeof(Type)}, null)); // fixme cache
|
||||
|
||||
if (_convertMethod == null)
|
||||
_convertMethod = typeof(Convert).GetMethod("ChangeType", BindingFlags.Public | BindingFlags.Static, null, new[] { typeof(object), typeof(Type) }, null);
|
||||
|
||||
ilgen.CallMethod(_convertMethod);
|
||||
}
|
||||
|
||||
// emits adapter code before OpCodes.Ret
|
||||
|
||||
Reference in New Issue
Block a user