Class LinqExtensions
A linq extensions.
Inheritance
Namespace: Microsoft.Health.Fhir.CodeGenCommon.Extensions
Assembly: Microsoft.Health.Fhir.CodeGenCommon.dll
Syntax
public static class LinqExtensions : object
Methods
| Improve this Doc View SourceCopyTo(HashSet<String>, HashSet<String>)
A HashSet<string> extension method that copies to.
Declaration
public static void CopyTo(this HashSet<string> source, HashSet<string> dest)
Parameters
Type | Name | Description |
---|---|---|
Hash |
source | The source dictionary to copy. |
Hash |
dest | Destination for the. |
DeepCopy<KT, VT>(Dictionary<KT, VT>)
A Dictionary<KT,VT> extension method that deep copies the dictionary.
Declaration
public static Dictionary<KT, VT> DeepCopy<KT, VT>(this Dictionary<KT, VT> source)
where VT : ICloneable
Parameters
Type | Name | Description |
---|---|---|
Dictionary<KT, VT> | source | The source dictionary to copy. |
Returns
Type | Description |
---|---|
Dictionary<KT, VT> | A Dictionary<KT,VT> |
Type Parameters
Name | Description |
---|---|
KT | Key Type. |
VT | Value Type. |
DeepCopy<KT, VT>(Dictionary<KT, List<VT>>)
A Dictionary<KT,VT> extension method that deep copies the dictionary.
Declaration
public static Dictionary<KT, List<VT>> DeepCopy<KT, VT>(this Dictionary<KT, List<VT>> source)
where VT : ICloneable
Parameters
Type | Name | Description |
---|---|---|
Dictionary<KT, List<VT>> | source | The source dictionary to copy. |
Returns
Type | Description |
---|---|
Dictionary<KT, List<VT>> | A Dictionary<KT,VT> |
Type Parameters
Name | Description |
---|---|
KT | Key Type. |
VT | Value Type. |
ForEach<T>(IEnumerable<T>, Action<T>)
An IEnumerable<T> extension method that applies an operation to all items in this collection.
Declaration
public static void ForEach<T>(this IEnumerable<T> ie, Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | ie | The IE to act on. |
Action<T> | action | The action. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
ForEach<T>(IEnumerable<T>, Func<T, Int32, Boolean>)
An IEnumerable<T> extension method that applies an operation to all items in this collection.
Declaration
public static bool ForEach<T>(this IEnumerable<T> ie, Func<T, int, bool> action)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | ie | The IE to act on. |
Func<T, System. |
action | The action. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
Type Parameters
Name | Description |
---|---|
T | Generic type parameter. |
ShallowCopy<KT, VT>(Dictionary<KT, VT>)
A Dictionary<KT,VT> extension method that shallow copies the given source.
Declaration
public static Dictionary<KT, VT> ShallowCopy<KT, VT>(this Dictionary<KT, VT> source)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<KT, VT> | source | The source dictionary to copy. |
Returns
Type | Description |
---|---|
Dictionary<KT, VT> | A Dictionary<KT,VT> |
Type Parameters
Name | Description |
---|---|
KT | Key Type. |
VT | Value Type. |
ShallowCopy<KT, VT>(Dictionary<KT, List<VT>>)
A Dictionary<KT,VT> extension method that shallow copies the given source.
Declaration
public static Dictionary<KT, List<VT>> ShallowCopy<KT, VT>(this Dictionary<KT, List<VT>> source)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<KT, List<VT>> | source | The source dictionary to copy. |
Returns
Type | Description |
---|---|
Dictionary<KT, List<VT>> | A Dictionary<KT,VT> |
Type Parameters
Name | Description |
---|---|
KT | Type of the kt. |
VT | Type of the vt. |