I am working with code something like the below. An array of BasketItemViewModel
is created in the scope of the Basket
class by looping DB results and creating a view model from each row.
When I ditch the Basket
class, and Set it to nothing, am I required to loop through the array of BasketItemViewModel
and set each of those to nothing too?
Class Basket
public GuidId
public BasketItemViewModels
public TotalItems
public TotalCost
Public Property Get TotalCostFormatted()
TotalCostFormatted = FormatCurrency(TotalCost,0)
End Property
public Default function Init(p_GuidId, p_TotalItems, p_TotalCost)
GuidId = p_GuidId
BasketItemViewModels = GetBasketItemViewModels()
TotalItems = p_TotalItems
TotalCost = p_TotalCost
set Init = Me
end function
public function GetBasketItemViewModels()
dim vmArray()
for each row in dbResults
// ...get some values...
set vmArray(i) = (new BasketItemViewModel) (price, quantity, productId)
next
GetBasketItemViewModels = vmArray
end function
End Class