Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim p As New Product
- If(p.Load(1))
- p.Name = "New Name"
- p.Save()
- End If
- Dim arrProds = Product.GetProducts()
- Dim prodSvc = ObjectFactory.GetInstance(Of IProductService)
- Dim prod = prodSvc.GetProduct(1) //Prod is an Instance of 'Product'
- prod.Name = "New Name"
- prodSvc.Save(prod)
- Dim arrRelatedProds = prod.RelatedProducts
- Class Product
- Function RelatedProducts() As IList(Of Product)
- // prodSvc is an instance of IProductService which is passed into the
- // Product class in the constructor (or via Dependency Injection)
- Return Me.prodSvc.GetRelatedProducts(Me.ProductID)
- End Function
- End Class
Add Comment
Please, Sign In to add comment