The generated view pattern is based on the if statement:
if (extentName == "EntityModelsStoreContainer.Supplier")
{
return GetView0();
}
if (extentName == "EntityModelsStoreContainer.Product")
{
return GetView1();
}
...
But the switch statement has better performance when the number of conditions is high. So, using switch instead of if can improve the overall performance:
switch(extentName )
{
case "EntityModelsStoreContainer.Supplier": return GetView0();
case "EntityModelsStoreContainer.Product": return GetView0();
...
}
The generated view pattern is based on the
if
statement:But the
switch
statement has better performance when the number of conditions is high. So, usingswitch
instead ofif
can improve the overall performance: