/// <summary>
        /// Makes the promocode no longer valid when user applies it
        /// </summary>
        /// <param name="promocode"></param>
        /// <returns></returns>
        public async Task <bool> ApplyPromocode(Promocode promocode)
        {
            promocode.IsActive = false;
            ReplaceOneResult replaceResult =
                await _context
                .Promocodes
                .ReplaceOneAsync(
                    filter : p => p.Id == promocode.Id,
                    replacement : promocode);

            return(replaceResult.IsAcknowledged && replaceResult.ModifiedCount > 0);
        }
 public async Task Create(Promocode promocode)
 {
     await _context.Promocodes.InsertOneAsync(promocode);
 }