< Summary

Information
Class: MyNet.Observable.Collections.Filters.ExpressionFilter<T>
Assembly: MyNet.Observable
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Observable/Collections/Filters/ExpressionFilter.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 28
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ProvideExpression()100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Observable/Collections/Filters/ExpressionFilter.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ExpressionFilter.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using System.Linq.Expressions;
 9
 10namespace MyNet.Observable.Collections.Filters;
 11
 12/// <summary>
 13/// Represents a filter that uses an expression to define the filtering criteria. The filter is based on a property of t
 14/// </summary>
 15/// <typeparam name="T">The type of items to be filtered.</typeparam>
 16/// <remarks>
 17/// Initializes a new instance of the <see cref="ExpressionFilter{T}"/> class with the specified expression and predicat
 18/// </remarks>
 19/// <param name="expression">The expression that specifies the property to filter on.</param>
 20public class ExpressionFilter<T>(Expression<Func<T, bool>> expression) : IFilter<T>
 21{
 22    /// <summary>
 23    /// Gets the name of the property being filtered, which is extracted from the body of the expression. The property n
 24    /// </summary>
 25    /// <returns>The expression that specifies the property to filter on.</returns>
 12326    public Expression<Func<T, bool>> ProvideExpression() => expression;
 27}
 28

Methods/Properties

ProvideExpression()