• Introduction
  • API Documentation
  • Sample Apps
  • GitHub

    Show / Hide Table of Contents
    • DynamicVML
      • AddNewDynamicItem
      • DynamicList<TViewModel, TOptions>
      • DynamicList<TViewModel>
      • DynamicListItem<TViewModel>
      • IDynamicList
      • IDynamicList<TValue>
      • IDynamicListItem
      • IDynamicListItem<TViewModel>
      • ListRenderMode
      • NewItemMethod
    • DynamicVML.Extensions
      • ControllerExtensions
      • EditorExtensions
      • EnumerableExtensions
      • ViewDataExtensions
    • DynamicVML.Internals
      • Constants
      • ItemDisplayParameters
      • ItemEditorParameters
      • ItemParameters
      • ListDisplayParameters
      • ListEditorParameters
      • ListParameters
      • Parameters
    • DynamicVML.Options
      • DynamicListAttribute
      • DynamicListDisplayOptions
      • DynamicListEditorOptions
      • DynamicListOptions

    Class EnumerableExtensions

    Contains extension methods to convert view models and option objects to DynamicList<TViewModel, TOptions>.

    Inheritance
    Object
    EnumerableExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: DynamicVML.Extensions
    Assembly: DynamicVML.dll
    Syntax
    public static class EnumerableExtensions

    Methods

    | Improve this Doc View Source

    ToDynamicList<TViewModel>(TViewModel, String)

    Wraps a single view model into a partial dynamic list that can be sent back to the client.

    Declaration
    public static DynamicList<TViewModel> ToDynamicList<TViewModel>(this TViewModel viewModel, string containerId)
        where TViewModel : class
    Parameters
    Type Name Description
    TViewModel viewModel

    The view model to be wrapped in a partial dynamic list.

    String containerId

    The div ID of the already existing dynamic list container.

    Returns
    Type Description
    DynamicList<TViewModel>

    A partial dynamic list with a single item that can be passed to the client.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions)

    Wraps a single view model into a partial dynamic list that can be sent back to the client.

    Declaration
    public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions>(this TViewModel viewModel, string containerId, TOptions options)
        where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
    Parameters
    Type Name Description
    TViewModel viewModel

    The view model to be wrapped in a partial dynamic list.

    String containerId

    The div ID of the already existing dynamic list container.

    TOptions options

    The options to be associated with your view model. Note that this method will set the ViewModel property of the given options object to the given viewModel.

    Returns
    Type Description
    DynamicList<TViewModel, TOptions>

    A partial dynamic list with a single item that can be passed to the client.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    TOptions

    The type of the options to be associated with your view model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>)

    Wraps a single view model into a partial dynamic list that can be sent back to the client.

    Declaration
    public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions>(this TViewModel viewModel, string containerId, Func<TViewModel, TOptions> optionsSelector)
        where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
    Parameters
    Type Name Description
    TViewModel viewModel

    The view model to be wrapped in a partial dynamic list.

    String containerId

    The div ID of the already existing dynamic list container.

    Func<TViewModel, TOptions> optionsSelector

    A function that can be used to define how your view model should be wrapped in a TOptions object.

    Returns
    Type Description
    DynamicList<TViewModel, TOptions>

    A partial dynamic list with a single item that can be passed to the client.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    TOptions

    The type of the options to be associated with your view model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>)

    Wraps a single view model into a partial dynamic list that can be sent back to the client.

    Declaration
    public static DynamicList<TViewModel> ToDynamicList<TViewModel, TModel>(this TModel model, string containerId, Func<TModel, TViewModel> viewModelSelector)
        where TViewModel : class
    Parameters
    Type Name Description
    TModel model

    The database model to be converted in a view model and wrapped in a partial dynamic list.

    String containerId

    The div ID of the already existing dynamic list container.

    Func<TModel, TViewModel> viewModelSelector

    A function that can be used to define how your view model should be created from your model.

    Returns
    Type Description
    DynamicList<TViewModel>

    A partial dynamic list with a single item that can be passed to the client.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    TModel

    The type of your (database) model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>)

    Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions>.

    Declaration
    public static DynamicList<TViewModel> ToDynamicList<TViewModel, TOptions>(this IEnumerable<TViewModel> viewModels)
        where TViewModel : class
    Parameters
    Type Name Description
    IEnumerable<TViewModel> viewModels

    The list of viewmodel objects to be wrapped in option objects and then added to the list.

    Returns
    Type Description
    DynamicList<TViewModel>

    A DynamicList<TViewModel, TOptions> containing the given viewModels.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    TOptions

    The type of the options to be associated with your view model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions>(IEnumerable<TViewModel>, Func<TViewModel, TOptions>)

    Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions>.

    Declaration
    public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions>(this IEnumerable<TViewModel> viewModels, Func<TViewModel, TOptions> optionsSelector)
        where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
    Parameters
    Type Name Description
    IEnumerable<TViewModel> viewModels

    The list of viewmodel objects to be wrapped in option objects and then added to the list.

    Func<TViewModel, TOptions> optionsSelector

    A function that can be used to configure the TOptions associated with each of your viewModels.

    Returns
    Type Description
    DynamicList<TViewModel, TOptions>

    A DynamicList<TViewModel, TOptions> containing the given viewModels.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    TOptions

    The type of the options to be associated with your view model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions>(IEnumerable<TOptions>)

    Converts a list of TOptions objects into a DynamicList<TViewModel, TOptions>.

    Declaration
    public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions>(this IEnumerable<TOptions> options)
        where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
    Parameters
    Type Name Description
    IEnumerable<TOptions> options

    The list of options objects to be added to the list.

    Returns
    Type Description
    DynamicList<TViewModel, TOptions>

    A DynamicList<TViewModel, TOptions> containing the given options.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    TOptions

    The type of the options to be associated with your view model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TModel>(IEnumerable<TModel>, Func<TModel, TViewModel>)

    Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions>.

    Declaration
    public static DynamicList<TViewModel> ToDynamicList<TViewModel, TModel>(this IEnumerable<TModel> models, Func<TModel, TViewModel> viewModelSelector)
        where TViewModel : class
    Parameters
    Type Name Description
    IEnumerable<TModel> models

    A list of database models to be converted into view models, and then inserted in a dynamic list.

    Func<TModel, TViewModel> viewModelSelector

    A function that can be used to define how your view model should be created from your model.

    Returns
    Type Description
    DynamicList<TViewModel>
    Type Parameters
    Name Description
    TViewModel

    The type of your view models.

    TModel

    The type of your (database) models.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>)

    Wraps a single view model into a partial dynamic list that can be sent back to the client.

    Declaration
    public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions, TModel>(this TModel model, string containerId, Func<TModel, TViewModel> viewModelSelector, Func<TModel, TOptions> optionsSelector)
        where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
    Parameters
    Type Name Description
    TModel model

    The database model to be converted in a view model and wrapped in a partial dynamic list.

    String containerId

    The div ID of the already existing dynamic list container.

    Func<TModel, TViewModel> viewModelSelector

    A function that can be used to define how your view model should be created from your model.

    Func<TModel, TOptions> optionsSelector

    A function that can be used to define how your view model should be wrapped in a TOptions object.

    Returns
    Type Description
    DynamicList<TViewModel, TOptions>

    A partial dynamic list with a single item that can be passed to the client.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    TOptions

    The type of the options to be associated with your view model.

    TModel

    The type of your (database) model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)

    Wraps a single view model into a partial dynamic list that can be sent back to the client.

    Declaration
    public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions, TModel>(this TModel model, string containerId, Func<TModel, TOptions> optionsSelector)
        where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
    Parameters
    Type Name Description
    TModel model

    The database model to be converted in a view model and wrapped in a partial dynamic list.

    String containerId

    The div ID of the already existing dynamic list container.

    Func<TModel, TOptions> optionsSelector

    A function that can be used to define how your view model should be wrapped in a TOptions object.

    Returns
    Type Description
    DynamicList<TViewModel, TOptions>

    A partial dynamic list with a single item that can be passed to the client.

    Type Parameters
    Name Description
    TViewModel

    The type of your view model.

    TOptions

    The type of the options to be associated with your view model.

    TModel

    The type of your (database) model.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions, TModel>(IEnumerable<TModel>, Func<TModel, TViewModel>, Func<TModel, TOptions>)

    Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions>.

    Declaration
    public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions, TModel>(this IEnumerable<TModel> models, Func<TModel, TViewModel> viewModelSelector, Func<TModel, TOptions> optionsSelector)
        where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
    Parameters
    Type Name Description
    IEnumerable<TModel> models

    A list of database models to be converted into view models, wrapped in TOptions objects, and then inserted in a dynamic list.

    Func<TModel, TViewModel> viewModelSelector

    A function that can be used to define how your view model should be created from your model.

    Func<TModel, TOptions> optionsSelector

    A function that can be used to define how your view model should be wrapped in a TOptions object.

    Returns
    Type Description
    DynamicList<TViewModel, TOptions>
    Type Parameters
    Name Description
    TViewModel

    The type of your view models.

    TOptions

    The type of the options to be associated with your view models.

    TModel

    The type of your (database) models.

    | Improve this Doc View Source

    ToDynamicList<TViewModel, TOptions, TModel>(IEnumerable<TModel>, Func<TModel, TOptions>)

    Converts a list of TViewModel objects into a DynamicList<TViewModel, TOptions>.

    Declaration
    public static DynamicList<TViewModel, TOptions> ToDynamicList<TViewModel, TOptions, TModel>(this IEnumerable<TModel> models, Func<TModel, TOptions> optionsSelector)
        where TViewModel : class where TOptions : DynamicListItem<TViewModel>, new()
    Parameters
    Type Name Description
    IEnumerable<TModel> models

    A list of database models to be converted into view models, wrapped in TOptions objects, and then inserted in a dynamic list.

    Func<TModel, TOptions> optionsSelector

    A function that can be used to define how your view model should be wrapped in a TOptions object.

    Returns
    Type Description
    DynamicList<TViewModel, TOptions>
    Type Parameters
    Name Description
    TViewModel

    The type of your view models.

    TOptions

    The type of the options to be associated with your view models.

    TModel

    The type of your (database) models.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 César Roberto de Souza - All files are available under the MIT license except the logo, which comes from FontAwesome.