forked from SciSharp/BotSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreController.cs
More file actions
43 lines (37 loc) · 1.09 KB
/
CoreController.cs
File metadata and controls
43 lines (37 loc) · 1.09 KB
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
using EntityFrameworkCore.BootKit;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BotSharp.Core
{
[Authorize]
[Produces("application/json")]
[Route("v1/[controller]")]
public class CoreController : ControllerBase
{
protected Database dc { get; set; }
public CoreController()
{
dc = new DefaultDataContextLoader().GetDefaultDc();
}
/*protected string GetConfig(string path)
{
if (string.IsNullOrEmpty(path)) return String.Empty;
return Database.Configuration.GetSection(path).Value;
}
protected List<KeyValuePair<string, string>> GetSection(string path)
{
return Database.Configuration.GetSection(path).AsEnumerable().ToList();
}*/
protected string CurrentUserId
{
get
{
return this.User.Claims.FirstOrDefault(x => x.Type.Equals("UserId")).Value;
}
}
}
}