public IHttpActionResult Get(Guid installationId) { var location = Config.StoreLocation; var store = new SiteUpdateStore(location); return(Ok(store.GetUpdateSummaries(installationId))); }
public SiteUpdateWorker(IServiceProvider services, IntervalWorkerConfiguration config, Guid sourceId) : base(services, config) { _sourceId = sourceId; _client = services.GetRequiredService <HttpClient>(); _siteUpdateStore = services.GetRequiredService <SiteUpdateStore>(); _db = services.GetRequiredService <Database>(); _clock = services.GetRequiredService <IClock>(); }
protected override void OnInit(EventArgs e) { var location = SiteUpdateConfigurationSection.GetSection().StoreLocation; var installationId = InstallationInformationFacade.InstallationId; _store = new SiteUpdateStore(location); _updates = _store.GetUpdateSummaries(installationId); base.OnInit(e); }
protected override void OnInit(EventArgs e) { var location = SiteUpdateConfigurationSection.GetSection().StoreLocation; var store = new SiteUpdateStore(location); var installationId = InstallationInformationFacade.InstallationId; var updates = store.GetUpdateSummaries(installationId); Update = updates.Single(u => u.Id == Guid.Parse(Request.QueryString["package"])); base.OnInit(e); }
public HttpResponseMessage GetStream(Guid installationId, Guid updateId) { var location = Config.StoreLocation; var store = new SiteUpdateStore(location); var updates = store.GetUpdateSummaries(installationId); var update = updates.Single(u => u.Id == updateId); var result = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StreamContent(store.GetZipStream(update)) }; result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/zip"); result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = update.FileName }; return(result); }
public SiteController(SiteUpdateStore store) { _store = store; }