C# Class CarbonFitness.BusinessLogic.Implementation.UserIngredientBusinessLogic

Inheritance: IUserIngredientBusinessLogic
Show file Open project: yodiz/CarbonFitness Class Usage Examples

Public Methods

Method Description
AddUserIngredient ( User user, string ingredientName, int measure, System.DateTime dateTime ) : UserIngredient
DeleteUserIngredient ( User user, int userIngredientId, System.DateTime date ) : void
GetNutrientAverage ( IEnumerable nutrientEntities, User user ) : INutrientAverage
GetNutrientHistory ( NutrientEntity nutrientEntity, User user ) : ILine
GetNutrientSumForDate ( User user, NutrientEntity entity, System.DateTime date ) : decimal
GetNutrientSumList ( IEnumerable nutrients, User user ) : IEnumerable
GetUserIngredients ( User user, System.DateTime dateTime ) : CarbonFitness.Data.Model.UserIngredient[]
UserIngredientBusinessLogic ( IUserIngredientRepository userIngredientRepository, IIngredientRepository ingredientRepository, INutrientRepository nutrientRepository ) : System
getDatesfromuserIngredient ( UserIngredient userIngredients ) : IEnumerable
getNutrientIngredientSumForDate ( System.DateTime date, IEnumerable userIngredients, decimal>.Func valueToSum ) : decimal

Private Methods

Method Description
Get100DaysUserIngredients ( User user ) : CarbonFitness.Data.Model.UserIngredient[]
GetExistingIngredient ( string ingredientName ) : Ingredient
GetValueSumPerDateFromUserIngredients ( IEnumerable userIngredients, decimal>.Func valueToSum ) : decimal>.Dictionary

Method Details

AddUserIngredient() public method

public AddUserIngredient ( User user, string ingredientName, int measure, System.DateTime dateTime ) : UserIngredient
user CarbonFitness.Data.Model.User
ingredientName string
measure int
dateTime System.DateTime
return CarbonFitness.Data.Model.UserIngredient

DeleteUserIngredient() public method

public DeleteUserIngredient ( User user, int userIngredientId, System.DateTime date ) : void
user CarbonFitness.Data.Model.User
userIngredientId int
date System.DateTime
return void

GetNutrientAverage() public method

public GetNutrientAverage ( IEnumerable nutrientEntities, User user ) : INutrientAverage
nutrientEntities IEnumerable
user CarbonFitness.Data.Model.User
return INutrientAverage

GetNutrientHistory() public method

public GetNutrientHistory ( NutrientEntity nutrientEntity, User user ) : ILine
nutrientEntity NutrientEntity
user CarbonFitness.Data.Model.User
return ILine

GetNutrientSumForDate() public method

public GetNutrientSumForDate ( User user, NutrientEntity entity, System.DateTime date ) : decimal
user CarbonFitness.Data.Model.User
entity NutrientEntity
date System.DateTime
return decimal

GetNutrientSumList() public method

public GetNutrientSumList ( IEnumerable nutrients, User user ) : IEnumerable
nutrients IEnumerable
user CarbonFitness.Data.Model.User
return IEnumerable

GetUserIngredients() public method

public GetUserIngredients ( User user, System.DateTime dateTime ) : CarbonFitness.Data.Model.UserIngredient[]
user CarbonFitness.Data.Model.User
dateTime System.DateTime
return CarbonFitness.Data.Model.UserIngredient[]

UserIngredientBusinessLogic() public method

public UserIngredientBusinessLogic ( IUserIngredientRepository userIngredientRepository, IIngredientRepository ingredientRepository, INutrientRepository nutrientRepository ) : System
userIngredientRepository IUserIngredientRepository
ingredientRepository IIngredientRepository
nutrientRepository INutrientRepository
return System

getDatesfromuserIngredient() public method

public getDatesfromuserIngredient ( UserIngredient userIngredients ) : IEnumerable
userIngredients CarbonFitness.Data.Model.UserIngredient
return IEnumerable

getNutrientIngredientSumForDate() public method

public getNutrientIngredientSumForDate ( System.DateTime date, IEnumerable userIngredients, decimal>.Func valueToSum ) : decimal
date System.DateTime
userIngredients IEnumerable
valueToSum decimal>.Func
return decimal