// within this using block make the DetachedMetadataStore == ms public static UsingBlock ShareWithDetached(MetadataStore ms) { return(UsingBlock.Create(MetadataStore.Detached, ms, (x) => MetadataStore.Detached = x)); }