Example #1
0
 public async Task CreatePrizeDrawHistory(PrizeDrawHistory item)
 {
     if (ModelState.IsValid)
     {
         var uid = HttpContext.User.FindFirst("user_id");
         item.Uid = uid.Value;
         _dbContext.Add(item);
         await _dbContext.SaveChangesAsync();
     }
 }
Example #2
0
 public async Task CreateCaptions(Caption item)
 {
     if (ModelState.IsValid)
     {
         var uid = HttpContext.User.FindFirst("user_id");
         item.Uid = uid.Value;
         _dbContext.Captions.Add(item);
         await _dbContext.SaveChangesAsync();
     }
 }