KEYWORD sequential #1816
Replies: 5 comments
-
Most of this looks like a normal Can you write examples as to how you'd accomplish this without new syntax? |
Beta Was this translation helpful? Give feedback.
-
@HaloFour |
Beta Was this translation helpful? Give feedback.
-
The keyword sequence makes everything in an array or list and traverses item by item so it can traverse any type. |
Beta Was this translation helpful? Give feedback.
-
How is that any different to foreach? |
Beta Was this translation helpful? Give feedback.
-
You can solve this using conventional var people = new People[] { ... };
// or
var people = new List<People>();
foreach (var p in people)
try
{
Validator.NotEmpty(p.Name, "Not Empty!");
Validator.MaxCaracter(p,Name, "Max caracter is 8", 8);
}
catch (Exception ex)
{
Console.WriteLine($"'{p}' could not be validated: {ex.Message}");
return;
} Why would we need a new keyword?
So I would like to ask you, why do we need |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
KEYWORD sequential
Model People
Validator methods
Keyword use case
Object
List
Primitive[]
Primitive
dynamic
In this example I want to demonstrate that a method if called within the sequential it does not run on how much it does not reach its turn, this scenario would be for validations and testing in methods a native form of summarizing code and grouping a particular operation.
Beta Was this translation helpful? Give feedback.
All reactions