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); } }
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); } }
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(); } }
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(); } }
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); } }
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(); } }
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); } }
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(); } }