internal static Skeleton GetOrCreateSkeleton <T>(T impl, bool addRef) where T : class { if (impl is Skeleton skel) { return(skel); } skel = _implMap.GetValue(impl, _ => CapabilityReflection.CreateSkeleton(_)); if (addRef) { skel.Claim(); } return(skel); }
internal static Skeleton GetOrCreateSkeleton <T>(T impl, bool addRef) where T : class { if (impl == null) { throw new ArgumentNullException(nameof(impl)); } if (impl is Skeleton skel) { return(skel); } skel = _implMap.GetValue(impl, _ => CapabilityReflection.CreateSkeleton(_)); if (addRef) { skel.Claim(); } return(skel); }