Class RangeFilterAttribute
Data object range filter attribute
Inherited Members
Namespace: XData.Mapping
Assembly: XData.docfx.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class RangeFilterAttribute : FilterAttribute
Remarks
Used to filter data by range of values (for example: some_field in (1, 2, 3)
or some_field not in (1, 2, 3)
)
Hint: Using dynamic LINQ range filters will increase code flexibility (see example).
Examples
var states = new List<int>();
// fill states from somewhere
dataScope.GetRepository<Invoice>().Where(x => states.Contains(x.State));
Constructors
| Improve this Doc View SourceRangeFilterAttribute(String, String, Object[])
Range filter attribute
Declaration
public RangeFilterAttribute(string source, string fieldName, params object[] range)
Parameters
Type | Name | Description |
---|---|---|
String | source | Primary source alias |
String | fieldName | Primary field name |
Object[] | range | Range values |
Exceptions
Type | Condition |
---|---|
XDataRuntimeException | Range values cannot be null or empty array |
Properties
| Improve this Doc View SourceFilterType
Filter type
Declaration
public override FilterType FilterType { get; }
Property Value
Type | Description |
---|---|
FilterType | Range |
Overrides
| Improve this Doc View SourceRange
Range values
Declaration
public object[] Range { get; }
Property Value
Type | Description |
---|---|
Object[] |
TypeId
When implemented in a derived class, gets a unique identifier for this Attribute.
Declaration
public override object TypeId { get; }
Property Value
Type | Description |
---|---|
Object | An Object that is a unique identifier for the attribute. |