private bool TryCreateStructuralType( Type type, StructuralType cspaceType, out EdmType newOSpaceType) { List <Action> referenceResolutionListForCurrentType = new List <Action>(); newOSpaceType = (EdmType)null; StructuralType ospaceType = !Helper.IsEntityType((EdmType)cspaceType) ? (StructuralType) new ClrComplexType(type, cspaceType.NamespaceName, cspaceType.Name) : (StructuralType) new ClrEntityType(type, cspaceType.NamespaceName, cspaceType.Name); if (cspaceType.BaseType != null) { if (OSpaceTypeFactory.TypesMatchByConvention(type.BaseType(), cspaceType.BaseType)) { this.TrackClosure(type.BaseType()); referenceResolutionListForCurrentType.Add((Action)(() => ospaceType.BaseType = this.ResolveBaseType((StructuralType)cspaceType.BaseType, type))); } else { this.LogLoadMessage(Strings.Validator_OSpace_Convention_BaseTypeIncompatible((object)type.BaseType().FullName, (object)type.FullName, (object)cspaceType.BaseType.FullName), (EdmType)cspaceType); return(false); } } if (!this.TryCreateMembers(type, cspaceType, ospaceType, referenceResolutionListForCurrentType)) { return(false); } this.LoadedTypes.Add(type.FullName, (EdmType)ospaceType); foreach (Action action in referenceResolutionListForCurrentType) { this.ReferenceResolutions.Add(action); } newOSpaceType = (EdmType)ospaceType; return(true); }