public static T EnsureObjectByKey <T>(this IObjectSpace objectSpace, object key, bool inTransaction = false) => objectSpace.GetObjectByKey <T>(key) ?? objectSpace.EnsureInTransaction <T>(key, inTransaction) ?? objectSpace.NewObject <T>(key);