// Dictionary<ProductCategory, int> PointsDictionary = new Dictionary<ProductCategory, int>(); public int GetPoints(IProduct product) { Gaurd.IsNotNull(product, nameof(product)); // We can add our logic to generat points // The Points can be fetched from DB based on the product category return(product.Category == ProductCategory.Electronics ? 100 : 50); }
public RewardController(IRewadsRepository rewadsRepository) { Gaurd.IsNotNull(rewadsRepository, nameof(rewadsRepository)); this.rewadsRepository = rewadsRepository; }
public DbConnection CreateSecondaryConnection() { Gaurd.AgainstNull(_queriesConnectionString, nameof(_queriesConnectionString)); return(new SqlConnection(_queriesConnectionString.Value));//); }
public RewadsRepository(DbContextOptions <RewardsContext> contextOptions) { Gaurd.IsNotNull(contextOptions, nameof(contextOptions)); this.contextOptions = contextOptions; }
public DbConnection CreatePrimaryConnection() { Gaurd.AgainstNull(_commandsConnectionString, nameof(_commandsConnectionString)); return(new SqlConnection(_commandsConnectionString.Value));//_commandsConnectionString.Value); Data Source = mello.database.windows.net;initial catalog=MelloApiDatabase;user id=mello;password= }