You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we want to integrate Mr. Advise into our company Framework. Our goal is it to reduce the parameter validation with a simple advice before a paramter.
Example before Mr. Advice: public static int GetNumberOfPages(string sourceFilePath) { // Validation if (String.IsNullOrEmpty(sourceFilePath)) throw new ArgumentNullException(nameof(sourceFilePath)); if (!File.Exists(sourceFilePath)) throw new FileNotFoundException(nameof(sourceFilePath)); ...
Exmaple after Mr. Advid: public static int GetNumberOfPages([PathNull][FileExist]string sourceFilePath) { ...
In some of our validations we, for example, check an integer for a range (like 1-100 or 1 - 65535). To realize that we have to create an advice for each range.
Is there a way to pass values into the adivce?
For exmaple like that?
public static int CreatePort([Range(1, 65535)]int port) { ...
The text was updated successfully, but these errors were encountered:
Hello,
we want to integrate Mr. Advise into our company Framework. Our goal is it to reduce the parameter validation with a simple advice before a paramter.
Example before Mr. Advice:
public static int GetNumberOfPages(string sourceFilePath)
{
// Validation
if (String.IsNullOrEmpty(sourceFilePath))
throw new ArgumentNullException(nameof(sourceFilePath));
if (!File.Exists(sourceFilePath))
throw new FileNotFoundException(nameof(sourceFilePath));
...
Exmaple after Mr. Advid:
public static int GetNumberOfPages([PathNull][FileExist]string sourceFilePath) { ...
In some of our validations we, for example, check an integer for a range (like 1-100 or 1 - 65535). To realize that we have to create an advice for each range.
Is there a way to pass values into the adivce?
For exmaple like that?
public static int CreatePort([Range(1, 65535)]int port)
{
...
The text was updated successfully, but these errors were encountered: