コード例 #1
0
 public string getHookSecret()
 {
     using (var db = new NinjacatorsEntities())
     {
         var clientId   = ConfigurationManager.AppSettings["ClientId"];
         var hookSecret = db.HookSecrets
                          .Where(x => x.client_id == clientId)
                          .OrderByDescending(x => x.id)
                          .FirstOrDefault();
         return(hookSecret.x_hook_secret);
     }
 }
コード例 #2
0
 public string getReferringAction()
 {
     using (var db = new NinjacatorsEntities())
     {
         var clientId        = ConfigurationManager.AppSettings["ClientId"];
         var referringAction = db.ReferringActions
                               .Where(x => x.client_id == clientId)
                               .OrderByDescending(x => x.id)
                               .FirstOrDefault();
         return(referringAction.referring_action);
     }
 }
コード例 #3
0
 public void saveHookSecret(string hookSecret)
 {
     using (var db = new NinjacatorsEntities())
     {
         db.HookSecrets.Add(new HookSecret()
         {
             client_id     = ConfigurationManager.AppSettings["ClientId"],
             x_hook_secret = hookSecret
         });
         db.SaveChanges();
     }
 }
コード例 #4
0
 public void saveReferringAction(string referringAction)
 {
     using (var db = new NinjacatorsEntities())
     {
         db.ReferringActions.Add(new ReferringAction()
         {
             client_id        = ConfigurationManager.AppSettings["ClientId"],
             referring_action = referringAction
         });
         db.SaveChanges();
     }
 }
コード例 #5
0
 public string getEventKey()
 {
     using (var db = new NinjacatorsEntities())
     {
         var clientId = ConfigurationManager.AppSettings["ClientId"];
         var eventKey = db.EventKeys
                        .Where(x => x.client_id == clientId)
                        .OrderByDescending(x => x.id)
                        .FirstOrDefault();
         return(eventKey.event_key);
     }
 }
コード例 #6
0
 public void saveEventKey(string eventKey)
 {
     using (var db = new NinjacatorsEntities())
     {
         db.EventKeys.Add(new EventKey()
         {
             client_id = ConfigurationManager.AppSettings["ClientId"],
             event_key = eventKey
         });
         db.SaveChanges();
     }
 }
コード例 #7
0
 public string getAccessToken()
 {
     using (var db = new NinjacatorsEntities())
     {
         var clientId = ConfigurationManager.AppSettings["ClientId"];
         var latestAccessTokenRecord = db.AccessTokens
                                       .Where(x => x.client_id == clientId)
                                       .OrderByDescending(x => x.id)
                                       .FirstOrDefault();
         return(latestAccessTokenRecord.access_token);
     }
 }
コード例 #8
0
 public void saveAccessToken(string accessToken)
 {
     using (var db = new NinjacatorsEntities())
     {
         db.AccessTokens.Add(new AccessToken()
         {
             client_id    = ConfigurationManager.AppSettings["ClientId"],
             access_token = accessToken
         });
         db.SaveChanges();
     }
 }