C# Class CardShop.Service.BaseballCardService

Inheritance: DbContext, IBaseballCardService
Show file Open project: egreene/PracticeGDVP

Public Methods

Method Description
BaseballCardService ( ) : System
Create ( BaseballCard baseballCard ) : void

Adds a new BaseballCard to DBSet

Delete ( int id ) : void

This method is not implemented yet

GetAllCards ( ) : List

Calls the DBSet.ToList() Method and returns all cards in list format.

GetBaseballCard ( int id ) : BaseballCard

Finds a single BaseballCard by the Id passed into the method. calls DBSet.Find(id)

SaveChanges ( ) : void

Calls DBContext.SaveChanges to save anything that may have changed in the DBContext

Update ( BaseballCard baseballCard ) : void

Updates BaseballCard in DBSet with information

Protected Methods

Method Description
OnModelCreating ( DbModelBuilder modelBuilder ) : void

Override to the DBContext Method to map entity to right table.

Method Details

BaseballCardService() public method

public BaseballCardService ( ) : System
return System

Create() public method

Adds a new BaseballCard to DBSet
public Create ( BaseballCard baseballCard ) : void
baseballCard CardShop.Models.BaseballCard BaseballCard to be added to the DBSet
return void

Delete() public method

This method is not implemented yet
public Delete ( int id ) : void
id int Id of the card to be deleted from the DBSet
return void

GetAllCards() public method

Calls the DBSet.ToList() Method and returns all cards in list format.
public GetAllCards ( ) : List
return List

GetBaseballCard() public method

Finds a single BaseballCard by the Id passed into the method. calls DBSet.Find(id)
public GetBaseballCard ( int id ) : BaseballCard
id int Id of the baseballCard to be found in DBSet
return CardShop.Models.BaseballCard

OnModelCreating() protected method

Override to the DBContext Method to map entity to right table.
protected OnModelCreating ( DbModelBuilder modelBuilder ) : void
modelBuilder DbModelBuilder
return void

SaveChanges() public method

Calls DBContext.SaveChanges to save anything that may have changed in the DBContext
public SaveChanges ( ) : void
return void

Update() public method

Updates BaseballCard in DBSet with information
public Update ( BaseballCard baseballCard ) : void
baseballCard CardShop.Models.BaseballCard BaseballCard to update
return void