-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathOAuthTokensRealmLastUpdateddto.cs
89 lines (68 loc) · 2.11 KB
/
OAuthTokensRealmLastUpdateddto.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
////*********************************************************
// <copyright company="Intuit">
// Author:Nimisha
//
////*********************************************************
using DevDefined.OAuth.Consumer;
using DevDefined.OAuth.Framework;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
namespace Webhooks.Models.DTO
{
public class OAuthTokensRealmLastUpdateddto
{
//Get OauthTokens table fields
public OAuthTokens OAuthTokens { get; set; }
//Get DB connection string from config where Oauth tokens and Realm's Last Updated time is saved
public string ConnectionString
{
get { return ConfigurationManager.ConnectionStrings["DBContext"].ToString(); }
}
//Get app consumer key from config
public string ConsumerKey
{
get
{
return ConfigurationManager.AppSettings["ConsumerKey"];
}
}
//Get app consumer secret from config
public string ConsumerSecret
{
get
{
return ConfigurationManager.AppSettings["ConsumerSecret"];
}
}
}
/// <summary>
/// Properties mapper class for OAuthTokens DB
/// </summary>
public class OAuthTokens
{
[Key]
public int Id { get; set; }
public string realmid { get; set; }
public DateTime realmlastupdated { get; set; }
public string access_token { get; set; }
public string access_secret { get; set; }
public string datasource { get; set; }
}
/// <summary>
/// DBContext for OAuthTokens
/// </summary>
public class OAuthRealmLastUpdateddataContext : DbContext
{
public OAuthRealmLastUpdateddataContext(string connString)
: base(connString)
{
}
public DbSet<OAuthTokens> Tokens_RealmLastUpdatedDate { get; set; }
}
}