public string GetJSForUser(string userId) { string webRootPath = hostingEnvironment.WebRootPath; string result = System.IO.File.ReadAllText(webRootPath + "/JavaScript.js"); var abtests = abTestsRepository.GetByUserId(userId).ToList(); result = result.Replace("@abTests", JsonConvert.SerializeObject(abtests)); return(result); }
public IEnumerable <ABTest> GetABTests() { return(abTestsRepository.GetByUserId(HttpContext.Session.GetString("UserId"))); }