Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

FilterParameter.cs

namespace Nop.Web.Framework.Models.DataTables;

/// 
/// Represent DataTables filter parameter
/// 
public partial class FilterParameter
{
    #region Ctor

    /// 
    /// Initializes a new instance of the FilterParameter class by default as string type parameter
    /// 
    /// Filter parameter name
    public FilterParameter(string name)
    {
        Name = name;
        Type = typeof(string);
    }

    /// 
    /// Initializes a new instance of the FilterParameter class
    /// 
    /// Filter parameter name
    /// Filter parameter model name
    public FilterParameter(string name, string modelName)
    {
        Name = name;
        ModelName = modelName;
        Type = typeof(string);
    }

    /// 
    /// Initializes a new instance of the FilterParameter class
    /// 
    /// Filter parameter name
    /// Filter parameter type
    public FilterParameter(string name, Type type)
    {
        Name = name;
        Type = type;
    }

    /// 
    /// Initializes a new instance of the FilterParameter class
    /// 
    /// Filter parameter name
    /// Filter parameter value
    public FilterParameter(string name, object value)
    {
        Name = name;
        Type = value.GetType();
        Value = value;
    }

    /// 
    /// Initializes a new instance of the FilterParameter class for linking "parent-child" tables
    /// 
    /// Filter parameter name
    /// Filter parameter parent name
    /// Parameter indicator for linking "parent-child" tables
    public FilterParameter(string name, string parentName, bool isParentChildParameter = true)
    {
        Name = name;
        ParentName = parentName;
        Type = typeof(string);
    }

    #endregion

    #region Properties

    /// 
    /// Filter field name
    /// 
    public string Name { get; }

    /// 
    /// Filter model name
    /// 
    public string ModelName { get; }

    /// 
    /// Filter field type
    /// 
    public Type Type { get; }

    /// 
    /// Filter field value
    /// 
    public object Value { get; set; }

    /// 
    /// Filter field parent name
    /// 
    public string ParentName { get; set; }

    #endregion
}