-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b908aa
commit 5be36e1
Showing
6 changed files
with
16 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
namespace SmartWhere.Attributes; | ||
|
||
[AttributeUsage(AttributeTargets.Property)] | ||
public class WhereClauseAttribute : Attribute | ||
public class WhereClauseAttribute(string propertyName, LogicalOperator logicalOperator = LogicalOperator.AND) | ||
: Attribute | ||
{ | ||
public string PropertyName { get; set; } | ||
public string PropertyName { get; set; } = propertyName; | ||
|
||
public LogicalOperator LogicalOperator { get; set; } | ||
public LogicalOperator LogicalOperator { get; set; } = logicalOperator; | ||
|
||
public WhereClauseAttribute(LogicalOperator logicalOperator = LogicalOperator.AND) => LogicalOperator = logicalOperator; | ||
|
||
public WhereClauseAttribute(string propertyName, LogicalOperator logicalOperator = LogicalOperator.AND) | ||
public WhereClauseAttribute(LogicalOperator logicalOperator = LogicalOperator.AND) : this(null, logicalOperator) | ||
{ | ||
PropertyName = propertyName; | ||
LogicalOperator = logicalOperator; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters