public static bool ContextKnowsType(this EntityObjectStore.LocalContext context, Type type) { // problem is that OSpace is not populated until an object set is created. // and there seems to be no way of navigating to the OSpace type from the CSpace. // for the moment then workaround by attempting to create an object set. // For complex types this will only work if the parent is queried first if (context.WrappedObjectContext.IsTypeInOSpace(type)) { return(true); } if (context.CanCreateObjectSet(type)) { return(true); } return(false); }
// problem is that OSpace is not populated until an object set is created. // and there seems to be no way of navigating to the OSpace type from the CSpace. // for the moment then workaround by attempting to create an object set. // For complex types this will only work if the parent is queried first public static bool ContextKnowsType(this EntityObjectStore.LocalContext context, Type type) => context.WrappedObjectContext.IsTypeInOSpace(type) || context.CanCreateObjectSet(type);