asked on
if (SOMETHING)
{
using (CustomersDao dao = CustomersDao())
{
//Do something with the object
}
}
else
{
using (CustomersDao dao = CustomersDao())
{
//Do something with the object
}
}
}
WHY NOT
CustomersDao dao;
if (SOMETHING)
{
dao = new CustomersDao();
{
//Do something with the object
}
}
else
{
dao = new CustomersDao();
{
//Do something with the object
}
}
}