-
Notifications
You must be signed in to change notification settings - Fork 5
C# Plus.NET Syntax Keyword
ZZZ Projects edited this page Nov 16, 2015
·
2 revisions
Plus.NET Keyword:
- Break All
- Break Outer
- Check
Break all loop (do, for, foreach, while) or switch statement.
int result = 0;
for (int x1 = 0; x1 < 10; x1++)
{
result += x1;
for (int x2 = 0; x2 < 10; x2++)
{
result += x2;
for (int x3 = 0; x3 < 10; x3++)
{
result += x3;
break outer;
// break this loop
}
// break this loop
}
// break this loop
}
return result;
This keyword is very useful in switch statement to break the outer loop or switch statement
Break the current and the first parent for a loop (do, for, foreach, while) or switch statement.
int result = 0;
for (int x1 = 0; x1 < 10; x1++)
{
result += x1;
for (int x2 = 0; x2 < 10; x2++)
{
result += x2;
for (int x3 = 0; x3 < 10; x3++)
{
result += x3;
break outer;
// break this loop
}
// break this loop
}
// doesn't break this loop
}
return result;
This keyword is very useful in switch statement to break the outer loop or switch statement
Checks whether the reference is null and then switches the control flow just like an 'if' statement.
Roslyn Request: https://github.com/dotnet/roslyn/issues/227
Customer customer = Customer.TryLoadFromDatabase(id)
check (customer)
{
// executed if the object is not null
customer.DoUpdate = true;
}
else
{
// executed if the object is null
customer = new Customer();
}
Entity Framework
Bulk Operations
Expression Evaluator
Utilities
Need more info? [email protected]
Contact our outstanding customer support for any request. We usually answer within the next business day, hour, or minutes!