#### [Apq\.Cfg](index.md 'index') ### [Apq\.Cfg\.Internal](Apq.Cfg.Internal.md 'Apq\.Cfg\.Internal').[FastCollections](Apq.Cfg.Internal.FastCollections.md 'Apq\.Cfg\.Internal\.FastCollections') ## FastCollections\.ToFastReadOnly Method | Overloads | | | :--- | :--- | | [ToFastReadOnly<TKey,TValue>\(this Dictionary<TKey,TValue>\)](Apq.Cfg.Internal.FastCollections.ToFastReadOnly.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.Dictionary_TKey,TValue_) 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.Dictionary\\)') | 创建高性能只读字典 | | [ToFastReadOnly<TKey,TValue>\(this IEnumerable<KeyValuePair<TKey,TValue>>\)](Apq.Cfg.Internal.FastCollections.ToFastReadOnly.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.IEnumerable_System.Collections.Generic.KeyValuePair_TKey,TValue__) 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.IEnumerable\\>\)') | 创建高性能只读字典 | ## FastCollections\.ToFastReadOnly\\(this Dictionary\\) Method 创建高性能只读字典 ```csharp public static Apq.Cfg.Internal.FastReadOnlyDictionary ToFastReadOnly(this System.Collections.Generic.Dictionary source) where TKey : notnull; ``` #### Type parameters `TKey` `TValue` #### Parameters `source` [System\.Collections\.Generic\.Dictionary<](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2 'System\.Collections\.Generic\.Dictionary\`2')[TKey](Apq.Cfg.Internal.FastCollections.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.Dictionary_TKey,TValue_).TKey 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.Dictionary\\)\.TKey')[,](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2 'System\.Collections\.Generic\.Dictionary\`2')[TValue](Apq.Cfg.Internal.FastCollections.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.Dictionary_TKey,TValue_).TValue 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.Dictionary\\)\.TValue')[>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2 'System\.Collections\.Generic\.Dictionary\`2') #### Returns [Apq\.Cfg\.Internal\.FastReadOnlyDictionary<](Apq.Cfg.Internal.FastReadOnlyDictionary_TKey,TValue_.md 'Apq\.Cfg\.Internal\.FastReadOnlyDictionary\')[TKey](Apq.Cfg.Internal.FastCollections.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.Dictionary_TKey,TValue_).TKey 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.Dictionary\\)\.TKey')[,](Apq.Cfg.Internal.FastReadOnlyDictionary_TKey,TValue_.md 'Apq\.Cfg\.Internal\.FastReadOnlyDictionary\')[TValue](Apq.Cfg.Internal.FastCollections.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.Dictionary_TKey,TValue_).TValue 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.Dictionary\\)\.TValue')[>](Apq.Cfg.Internal.FastReadOnlyDictionary_TKey,TValue_.md 'Apq\.Cfg\.Internal\.FastReadOnlyDictionary\') ## FastCollections\.ToFastReadOnly\\(this IEnumerable\\>\) Method 创建高性能只读字典 ```csharp public static Apq.Cfg.Internal.FastReadOnlyDictionary ToFastReadOnly(this System.Collections.Generic.IEnumerable> source) where TKey : notnull; ``` #### Type parameters `TKey` `TValue` #### Parameters `source` [System\.Collections\.Generic\.IEnumerable<](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[System\.Collections\.Generic\.KeyValuePair<](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.keyvaluepair-2 'System\.Collections\.Generic\.KeyValuePair\`2')[TKey](Apq.Cfg.Internal.FastCollections.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.IEnumerable_System.Collections.Generic.KeyValuePair_TKey,TValue__).TKey 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.IEnumerable\\>\)\.TKey')[,](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.keyvaluepair-2 'System\.Collections\.Generic\.KeyValuePair\`2')[TValue](Apq.Cfg.Internal.FastCollections.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.IEnumerable_System.Collections.Generic.KeyValuePair_TKey,TValue__).TValue 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.IEnumerable\\>\)\.TValue')[>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.keyvaluepair-2 'System\.Collections\.Generic\.KeyValuePair\`2')[>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1') #### Returns [Apq\.Cfg\.Internal\.FastReadOnlyDictionary<](Apq.Cfg.Internal.FastReadOnlyDictionary_TKey,TValue_.md 'Apq\.Cfg\.Internal\.FastReadOnlyDictionary\')[TKey](Apq.Cfg.Internal.FastCollections.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.IEnumerable_System.Collections.Generic.KeyValuePair_TKey,TValue__).TKey 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.IEnumerable\\>\)\.TKey')[,](Apq.Cfg.Internal.FastReadOnlyDictionary_TKey,TValue_.md 'Apq\.Cfg\.Internal\.FastReadOnlyDictionary\')[TValue](Apq.Cfg.Internal.FastCollections.md#Apq.Cfg.Internal.FastCollections.ToFastReadOnly_TKey,TValue_(thisSystem.Collections.Generic.IEnumerable_System.Collections.Generic.KeyValuePair_TKey,TValue__).TValue 'Apq\.Cfg\.Internal\.FastCollections\.ToFastReadOnly\\(this System\.Collections\.Generic\.IEnumerable\\>\)\.TValue')[>](Apq.Cfg.Internal.FastReadOnlyDictionary_TKey,TValue_.md 'Apq\.Cfg\.Internal\.FastReadOnlyDictionary\')