C# Class openTill.Persistence.CategoryRepository

A class that actually performs the CRUD operations for a Category.
Inheritance: ICategoryRepository
Show file Open project: CIT275DevGroup/openTill Class Usage Examples

Public Methods

Method Description
Delete ( CategoryDTO categoryDel ) : void

Deletes a category.

GetAll ( ) : IEnumerable

Returns all categories.

GetByName ( string name ) : CategoryDTO

Returns a category with a name matching the given name. Returns a null category if no match is found.

Insert ( CategoryDTO newCategory ) : void

Submits a new category for persistence.

Update ( CategoryDTO categoryUpdate ) : void

Updates an existing category.

Method Details

Delete() public method

Deletes a category.
public Delete ( CategoryDTO categoryDel ) : void
categoryDel openTill.Domain.DTO.CategoryDTO Category to delete
return void

GetAll() public method

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

GetByName() public method

Returns a category with a name matching the given name. Returns a null category if no match is found.
public GetByName ( string name ) : CategoryDTO
name string Category name
return openTill.Domain.DTO.CategoryDTO

Insert() public method

Submits a new category for persistence.
public Insert ( CategoryDTO newCategory ) : void
newCategory openTill.Domain.DTO.CategoryDTO New category to save
return void

Update() public method

Updates an existing category.
public Update ( CategoryDTO categoryUpdate ) : void
categoryUpdate openTill.Domain.DTO.CategoryDTO Category to update
return void