Hi,
I was looking at the generated code and saw a lot of these kind of coding constructions in this case the weblibrary/data/ProviderDataSource.cst:
public ProviderDataSourceInsertMethod InsertMethod
{
get
{
ProviderDataSourceInsertMethod insertMethod = ProviderDataSourceInsertMethod.<%= insertMethods[0] %>;
Object method = ViewState["InsertMethod"];
if ( method != null )
{
insertMethod = (ProviderDataSourceInsertMethod) method;
}
return insertMethod;
}
wouldn't the following code be better?
public ProviderDataSourceInsertMethod InsertMethod
{
get
{
ProviderDataSourceInsertMethod insertMethod = null;
Object method = ViewState["InsertMethod"];
if ( method != null )
{
insertMethod = (ProviderDataSourceInsertMethod) method;
}
else
{
insertMethod = ProviderDataSourceInsertMethod.<%= insertMethods[0] %>
}
return insertMethod;
}
Because now it doesn't have to execute unnessesary code
Just my 2 cents