public static Guid GetId(object instance) { var shadow = ShadowObject.GetShadow(instance); if (shadow == null) { return(Guid.Empty); } return(shadow.GetId(instance)); }
/// <summary> /// Remove all overrides information attached to an instance (Note that this method is not recursive and must be applied on all object). /// </summary> /// <param name="instance">An object instance</param> public static void RemoveFrom(object instance) { if (instance == null) throw new ArgumentNullException(nameof(instance)); var shadow = ShadowObject.GetShadow(instance); if (shadow == null) { return; } // Remove override information from an object foreach (var attributes in shadow.Members) { attributes.Attributes.Remove(OverrideKey); } }
public static void SetId(object instance, Guid id) { var shadow = ShadowObject.GetShadow(instance); shadow?.SetId(instance, id); }