C# Class openTill.Domain.Services.ProductService

A road map that performs the CRUD operations for a Product
Inheritance: IProductService
Mostra file Open project: CIT275DevGroup/openTill

Public Methods

Method Description
GetAllProducts ( ) : List

Method calls on repository to return a list of all Products from the database.

GetProductByUPC ( string givenUPC ) : ProductDTO

Method calls on repository to return a single Product based on UPC code.

GetProductsByBrand ( string givenBrand ) : List

Method calls on repository to return a list of Products by Brand.

ProductService ( IProductRepository productRepository ) : System

Constructor that requires a repository as a parameter.

RemoveProduct ( ProductDTO product ) : void

Method calls on repository to delete a Product.

SaveProduct ( ProductDTO product ) : void

Method calls on repository to save a Product.

Method Details

GetAllProducts() public method

Method calls on repository to return a list of all Products from the database.
public GetAllProducts ( ) : List
return List

GetProductByUPC() public method

Method calls on repository to return a single Product based on UPC code.
public GetProductByUPC ( string givenUPC ) : ProductDTO
givenUPC string The UPC used for lookup.
return openTill.Domain.DTO.ProductDTO

GetProductsByBrand() public method

Method calls on repository to return a list of Products by Brand.
public GetProductsByBrand ( string givenBrand ) : List
givenBrand string Name of the brand for lookup.
return List

ProductService() public method

Constructor that requires a repository as a parameter.
public ProductService ( IProductRepository productRepository ) : System
productRepository IProductRepository Repository to be used.
return System

RemoveProduct() public method

Method calls on repository to delete a Product.
public RemoveProduct ( ProductDTO product ) : void
product openTill.Domain.DTO.ProductDTO The Product to be deleted.
return void

SaveProduct() public method

Method calls on repository to save a Product.
public SaveProduct ( ProductDTO product ) : void
product openTill.Domain.DTO.ProductDTO The Product to be saved.
return void