public IndexViewModelRepository(string userId, string userName, string userToken, string siteId, string siteName, string cacheFolderLocation, string favouritesCacheFolderLocation, string categoriesCacheFolderLocation) : base(new XmlFileCacheProvider <IndexViewModel> { UserId = userId, UserName = userName, FilePrefix = "IndexViewModel", FolderLocation = cacheFolderLocation }) { UserId = userId; UserName = userName; UserToken = userToken; SiteId = siteId; SiteName = siteName; _tSettings = new TableauSettings(); _tService = new TableauService(_tSettings.ServerUrl, _tSettings.ApiVersion); _tService.LogEventHandler += HandleLogEvents; _favCache = new XmlFileCacheProvider <UserFavLists> { UserId = userId, UserName = userName, FilePrefix = "FavList", FolderLocation = favouritesCacheFolderLocation, DefaultValue = new UserFavLists { UserId = UserId, UserName = UserName, SiteFavsList = new List <SiteFavs> { new SiteFavs { SiteId = siteId, WorkbookList = new List <FavWorkbook>() } } } }; _categoryCache = new XmlFileCacheProvider <UserCategories> { UserId = userId, UserName = userName, FilePrefix = "Categories", FolderLocation = categoriesCacheFolderLocation, DefaultValue = new UserCategories { UserId = UserId, UserName = UserName, SiteCategoriesList = new List <SiteCategories> { new SiteCategories { SiteId = siteId, SiteName = siteName, Categories = new List <Category>() } } } }; LocalCache = CacheProvider.Get(); }
public AccountController() { _tService = new TableauService(TableauSettings.ServerUrl, TableauSettings.ApiVersion); _tService.LogEventHandler += HandleLogEvents; }