C# Class BudgetAnalyser.Engine.Budget.InMemoryBudgetBucketRepository

Inheritance: IBudgetBucketRepository
Afficher le fichier Open project: Benrnz/BudgetAnalyser Class Usage Examples

Méthodes publiques

Méthode Description
CreateNewFixedBudgetProject ( string bucketCode, string description, decimal fixedBudgetAmount ) : FixedBudgetProjectBucket

Creates the new fixed budget project.

GetByCode ( string code ) : BudgetBucket

Gets a bucket by its code.

GetOrCreateNew ( string code, Func factory ) : BudgetBucket

Gets the bucket by its code or creates a new one if not found.

InMemoryBudgetBucketRepository ( BudgetBucket>.[ mapper ) : System

Initializes a new instance of the InMemoryBudgetBucketRepository class.

Initialise ( IEnumerable buckets ) : void

Initialises the buckets from the provided data. Used by persistence.

IsValidCode ( string code ) : bool

Determines whether the bucket code is registered in this repository.

RemoveFixedBudgetProject ( FixedBudgetProjectBucket projectBucket ) : void

Removes the fixed budget project bucket permanently

Méthodes protégées

Méthode Description
AddBucket ( [ bucket ) : void

Adds the bucket.

InitialiseMandatorySpecialBuckets ( ) : void

Initialises the mandatory special buckets.

Private Methods

Méthode Description
ContainsKeyInternal ( string code ) : bool

Method Details

AddBucket() protected méthode

Adds the bucket.
protected AddBucket ( [ bucket ) : void
bucket [
Résultat void

CreateNewFixedBudgetProject() public méthode

Creates the new fixed budget project.
/// /// The fixed budget amount must be greater than zero. /// or /// A new fixed budget project bucket cannot be created, because the code + bucketCode + already exists. ///
public CreateNewFixedBudgetProject ( string bucketCode, string description, decimal fixedBudgetAmount ) : FixedBudgetProjectBucket
bucketCode string The bucket code.
description string The description.
fixedBudgetAmount decimal The fixed budget amount.
Résultat FixedBudgetProjectBucket

GetByCode() public méthode

Gets a bucket by its code.
public GetByCode ( string code ) : BudgetBucket
code string The code, also used as a key and must be unique.
Résultat BudgetBucket

GetOrCreateNew() public méthode

Gets the bucket by its code or creates a new one if not found.
///
public GetOrCreateNew ( string code, Func factory ) : BudgetBucket
code string The code, also used as a key and must be unique.
factory Func The factory to create the new bucket if not already registered.
Résultat BudgetBucket

InMemoryBudgetBucketRepository() public méthode

Initializes a new instance of the InMemoryBudgetBucketRepository class.
///
public InMemoryBudgetBucketRepository ( BudgetBucket>.[ mapper ) : System
mapper BudgetBucket>.[
Résultat System

Initialise() public méthode

Initialises the buckets from the provided data. Used by persistence.
public Initialise ( IEnumerable buckets ) : void
buckets IEnumerable
Résultat void

InitialiseMandatorySpecialBuckets() protected méthode

Initialises the mandatory special buckets.
protected InitialiseMandatorySpecialBuckets ( ) : void
Résultat void

IsValidCode() public méthode

Determines whether the bucket code is registered in this repository.
public IsValidCode ( string code ) : bool
code string The code, also used as a key and must be unique.
Résultat bool

RemoveFixedBudgetProject() public méthode

Removes the fixed budget project bucket permanently
public RemoveFixedBudgetProject ( FixedBudgetProjectBucket projectBucket ) : void
projectBucket FixedBudgetProjectBucket The project bucket to remove.
Résultat void