C# Class openTill.Persistence.ProductRepository

A class that actually perform the CRUD operations of a Product.
Inheritance: IProductRepository
Show file Open project: CIT275DevGroup/openTill Class Usage Examples

Public Methods

Method Description
Delete ( ProductDTO productDel ) : void

Deletes a product.

GetAll ( ) : IEnumerable

Returns all products.

GetByBrand ( string brand ) : IEnumerable

Returns all products that match the given brand.

GetByUPC ( string upc ) : ProductDTO

Returns a product matching the given upc. If no matching product is found an empty product is returned.

Insert ( ProductDTO newProduct ) : void

Submits a new product for persistence.

Update ( ProductDTO productUpdate ) : void

Updates an existing product.

Method Details

Delete() public method

Deletes a product.
public Delete ( ProductDTO productDel ) : void
productDel openTill.Domain.DTO.ProductDTO Product to delete
return void

GetAll() public method

Returns all products.
public GetAll ( ) : IEnumerable
return IEnumerable

GetByBrand() public method

Returns all products that match the given brand.
public GetByBrand ( string brand ) : IEnumerable
brand string String product brand
return IEnumerable

GetByUPC() public method

Returns a product matching the given upc. If no matching product is found an empty product is returned.
public GetByUPC ( string upc ) : ProductDTO
upc string String product upc
return openTill.Domain.DTO.ProductDTO

Insert() public method

Submits a new product for persistence.
public Insert ( ProductDTO newProduct ) : void
newProduct openTill.Domain.DTO.ProductDTO New product to save
return void

Update() public method

Updates an existing product.
public Update ( ProductDTO productUpdate ) : void
productUpdate openTill.Domain.DTO.ProductDTO Product to update
return void