public async Task CreateBootMessage(Models.BootMessage bootMessage) { using (DataContext = new SimplySecureDataContext()) { DataContext.BootMessages.Add(bootMessage); await DataContext.SaveChangesAsync(); } }
public async Task <ModuleResponse> PostBootToBackendApi(Models.BootMessage bootMessage) { using (var client = ApplicationHttpClient(ApplicationConfig.BackendUri)) { var response = await client.PostAsJsonAsync(BackendServerEndPoint.ModuleBoot, bootMessage); if (response.IsSuccessStatusCode) { var moduleResponse = await response.Content.ReadAsAsync <ModuleResponse>(); return(moduleResponse); } var ex = ApiException.CreateApiException(response); throw ex; } }