C# Class openTill.Domain.Services.CategoryService

A road map to perform the CRUD operations for a Category object.
Inheritance: ICategoryService
Exibir arquivo Open project: CIT275DevGroup/openTill Class Usage Examples

Public Methods

Method Description
CategoryService ( ICategoryRepository categoryRepository ) : System

Constructor that requires a repository as a parameter.

Delete ( CategoryDTO categoryToDelete ) : void

Method calls on repository to remove a Category field from the database.

GetAll ( ) : List

Method calls on repository in the DAL to get all Category listing form the database.

GetByName ( string categoryName ) : CategoryDTO

Method calls on repository for a specific category from the database based on name.

Insert ( CategoryDTO categoryToInsert ) : void

Method calls on repository to insert a new category field into the database.

Update ( CategoryDTO categoryToUpdate ) : void

Method calls on repository to update an exisiting field in the database.

Method Details

CategoryService() public method

Constructor that requires a repository as a parameter.
public CategoryService ( ICategoryRepository categoryRepository ) : System
categoryRepository ICategoryRepository Repository to be used.
return System

Delete() public method

Method calls on repository to remove a Category field from the database.
public Delete ( CategoryDTO categoryToDelete ) : void
categoryToDelete openTill.Domain.DTO.CategoryDTO Category that is to be removed from the database.
return void

GetAll() public method

Method calls on repository in the DAL to get all Category listing form the database.
public GetAll ( ) : List
return List

GetByName() public method

Method calls on repository for a specific category from the database based on name.
public GetByName ( string categoryName ) : CategoryDTO
categoryName string The name of the category to retrieve.
return openTill.Domain.DTO.CategoryDTO

Insert() public method

Method calls on repository to insert a new category field into the database.
public Insert ( CategoryDTO categoryToInsert ) : void
categoryToInsert openTill.Domain.DTO.CategoryDTO Category Data Transfer Object to insert into the database.
return void

Update() public method

Method calls on repository to update an exisiting field in the database.
public Update ( CategoryDTO categoryToUpdate ) : void
categoryToUpdate openTill.Domain.DTO.CategoryDTO Category that is to be updated.
return void