public async Task <List <GenerateOutPutDto> > GenerateCode(CodeInputDto input)
        {
            var result = new List <GenerateOutPutDto>();

            try
            {
                var createdDate = DateTime.Now;
                var codes       = await _context.RedeemCodes.Select(x => x.Code).ToListAsync();

                var type = await _context.ProductTypes.FindAsync(input.TypeId);

                type.GeneratedCount       += input.Count;
                _context.Entry(type).State = EntityState.Modified;
                if (input.Count > 0)
                {
                    for (int i = 0; i < input.Count; i++)
                    {
                        var redeemCode = new RedeemCode()
                        {
                            TypeId        = input.TypeId,
                            Code          = CodeService.GenerateNewCode(codes),
                            Status        = Domain.Enums.Status.NotActivated,
                            CreatedDate   = createdDate,
                            CreatedUserId = input.UserId
                        };
                        _context.RedeemCodes.Add(redeemCode);
                    }
                }
                await _context.SaveChangesAsync();

                var _result = await _context.RedeemCodes.Where(x => !x.VirtualDeleted && x.CreatedDate.Value == createdDate).ToListAsync();

                var __result = _result.Select(x => new GenerateOutPutDto()
                {
                    Code            = x.Code,
                    Id              = x.Id,
                    CreatedDate     = x.CreatedDate.Value.ToString(),
                    CreatedDateTime = x.CreatedDate.Value,
                    ProductType     = x.ProductType.Name
                });
                return(__result.ToList());
            }
            catch (Exception ex)
            {
                return(result);
            }
        }