internal static DataContract?As(this DataContract dataContract, DataContractType dcType) { if (dataContract.GetContractType() == dcType) { return(dataContract); } return(null); }
internal static bool IsItemTypeNullable(this DataContract collectionDataContract) { if (collectionDataContract.GetContractType() == DataContractType.CollectionDataContract) { // ItemContract - aka BaseContract - is never null for CollectionDataContract return(SchemaImportHelper.IsTypeNullable(collectionDataContract.BaseContract !.UnderlyingType)); } return(false); }
internal static bool Is(this DataContract dataContract, DataContractType dcType) { return(dataContract.GetContractType() == dcType); }