Ejemplo n.º 1
0
 public int GenerateandSaveToken(APIManagerTB APIManagerTB)
 {
     try
     {
         _context.APIManagerTB.Add(APIManagerTB);
         return(_context.SaveChanges());
     }
     catch (Exception)
     {
         throw;
     }
 }
        public int GenerateKey(GenerateKeysVM GenerateKeysVM)
        {
            try
            {
                APIManagerTB aPIManagerTB = new APIManagerTB()
                {
                    APIKey    = EncryptionLibrary.KeyGenerator.GetUniqueKey(),
                    HitsID    = GenerateKeysVM.HitsID,
                    CreatedOn = DateTime.Now,
                    ServiceID = GenerateKeysVM.ServiceID,
                    UserID    = Convert.ToInt32(HttpContext.Session.GetString("UserID")),
                    Status    = "A"
                };

                return(_IAPIManager.GenerateandSaveToken(aPIManagerTB));
            }
            catch (Exception)
            {
                throw;
            }
        }