Esempio n. 1
0
 public ProjectsController(IGitBanDataContext dataContext, IGitHubAdapter gitHubAdapter)
 {
     CurrentDataContext = dataContext;
     _gitHub = gitHubAdapter;
 }
Esempio n. 2
0
 public AuthController(IGitHubAdapter gitHubAdapter, IGitBanDataContext dataContext)
 {
     _dataContext = dataContext;
     _gitHub = gitHubAdapter;
 }
 private static User GetCurrentUser(IGitBanDataContext dataContext)
 {
     int userId;
     return Int32.TryParse(Thread.CurrentPrincipal.Identity.Name, out userId) ? dataContext.Users.SingleOrDefault(x => x.Id == userId) : null;
 }