Class CSharpModelExtensions
Extension class that manages extensions for the c# models.
Inherited Members
Namespace: CodeFactory.DotNet.CSharp
Assembly: CodeFactory.DotNet.dll
Syntax
public static class CSharpModelExtensions
Methods
| Improve this Doc View SourceClassIterator(IEnumerable<CsContainer>)
Iterator that returns CsClass models from an enumeration of ICsContainer
Declaration
public static IEnumerable<CsClass> ClassIterator(this IEnumerable<CsContainer> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CsContainer> | source | The source container to iterate over. |
Returns
Type | Description |
---|---|
IEnumerable<CsClass> | The iterator to be executed. |
EventIterator(IEnumerable<CsMember>)
Declaration
public static IEnumerable<CsEvent> EventIterator(this IEnumerable<CsMember> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CsMember> | source | The source container to iterate over. |
Returns
Type | Description |
---|---|
IEnumerable<CsEvent> | The iterator to be executed. |
FieldIterator(IEnumerable<CsMember>)
Declaration
public static IEnumerable<CsField> FieldIterator(this IEnumerable<CsMember> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CsMember> | source | The source container to iterate over. |
Returns
Type | Description |
---|---|
IEnumerable<CsField> | The iterator to be executed. |
InterfaceIterator(IEnumerable<CsContainer>)
Iterator that returns CsInterface models from an enumeration of ICsContainer
Declaration
public static IEnumerable<CsInterface> InterfaceIterator(this IEnumerable<CsContainer> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CsContainer> | source | The source container to iterate over. |
Returns
Type | Description |
---|---|
IEnumerable<CsInterface> | The iterator to be executed. |
MethodIterator(IEnumerable<CsMember>)
Declaration
public static IEnumerable<CsMethod> MethodIterator(this IEnumerable<CsMember> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CsMember> | source | The source container to iterate over. |
Returns
Type | Description |
---|---|
IEnumerable<CsMethod> | The iterator to be executed. |
ModelIterator<T>(IEnumerable<CsModel>)
Iterator that returns the target model type from an enumeration of ICsModel
Declaration
public static IEnumerable<T> ModelIterator<T>(this IEnumerable<CsModel> source) where T : class, ICsModel
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CsModel> | source | The source container to iterate over. |
Returns
Type | Description |
---|---|
IEnumerable<T> | The iterator to be executed. |
Type Parameters
Name | Description |
---|---|
T | The target type of model to return. |
PropertyIterator(IEnumerable<CsMember>)
Iterator that returns CsProperty models from an enumeration of CsMember
Declaration
public static IEnumerable<CsProperty> PropertyIterator(this IEnumerable<CsMember> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CsMember> | source | The source container to iterate over. |
Returns
Type | Description |
---|---|
IEnumerable<CsProperty> | The iterator to be executed. |
StructureIterator(IEnumerable<CsContainer>)
Iterator that returns CsStructure models from an enumeration of ICsContainer
Declaration
public static IEnumerable<CsStructure> StructureIterator(this IEnumerable<CsContainer> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CsContainer> | source | The source container to iterate over. |
Returns
Type | Description |
---|---|
IEnumerable<CsStructure> | The iterator to be executed. |
ToModel<T>(CsModel)
Extension method that converts a C# model into a target C# model format. If the cast does not apply then a null will be returned.
Declaration
public static T ToModel<T>(this CsModel source) where T : class, ICsModel
Parameters
Type | Name | Description |
---|---|---|
CsModel | source | The source model to transform. |
Returns
Type | Description |
---|---|
T | The c# model cast to the target type or null if the cast is invalid. |
Type Parameters
Name | Description |
---|---|
T | The target type of model to return. |