I have two methods, A and B. Only after the success of two the methods I have to insert into a database. So is this a valid conditional Statement in C#?
if (A() && B())
{
//insert into db
}
After the execution of method A I have to execute B. If both are successful I have to do the insert.
Yes it is valid. But note that
Bwill only execute ifA()returns true.