public List <AppModel> GetAllApps() { try { _db = new AppListDBContext(); return(_db.Applications.Select(x => new AppModel { Id = x.Id, Name = x.Name, Description = x.Description, ProductionUrl = x.ProductionUrl, FriendlyUrl = x.FriendlyUrl, TestUrl = x.TestUrl, Database = x.Database, DatabaseVersion = x.DatabaseVersion, DatabaseInstance = x.DatabaseInstance, TestDatabase = x.TestDatabase, WebServer = x.WebServer, MvcVersion = x.MvcVersion, NetVersion = x.NetVersion, AppPoolName = x.AppPoolName, FilePath = x.FilePath, TfsPath = x.TfsPath, EndDateTime = x.EndDateTime, DevIp = x.DevIp, ProdIp = x.ProdIp }) .ToList()); } catch (Exception e) { Console.WriteLine(e); throw; } }
public string GrabAppName(int appId) { using (AppListDBContext _db = new AppListDBContext()) { try { var application = _db.Applications.SingleOrDefault(x => x.Id == appId); return(application.Name); } catch (Exception e) { Console.WriteLine(e); throw; } } }
public List <AppModel> GrabAdminUserApps(string blazerId) { using (AppListDBContext _db = new AppListDBContext()) { try { List <int> userInstances = GrabAdminUserAppIds(blazerId); List <AppModel> apps = _db.Applications.Where(x => userInstances.Contains(x.Id)).Select(x => new AppModel { Id = x.Id, Name = x.Name, Description = x.Description, ProductionUrl = x.ProductionUrl, FriendlyUrl = x.FriendlyUrl, TestUrl = x.TestUrl, Database = x.Database, DatabaseVersion = x.DatabaseVersion, TestDatabase = x.TestDatabase, WebServer = x.WebServer, MvcVersion = x.MvcVersion, AppPoolName = x.AppPoolName, FilePath = x.FilePath, TfsPath = x.TfsPath, EndDateTime = x.EndDateTime, DevIp = x.DevIp, ProdIp = x.ProdIp }).ToList(); return(apps); } catch (Exception e) { Console.WriteLine(e); throw; } } }