Some checks failed
Build and Publish Docker Image / build-and-push (push) Has been cancelled
- Implemented CreateInstanceView for creating new instances. - Added HostsView for managing SSH hosts with CRUD operations. - Created InstancesView for displaying and managing instances. - Developed LogsView for viewing operation logs. - Introduced SecretsView for managing secrets associated with hosts. - Established SettingsView for configuring application settings. - Created MainWindow as the main application window with navigation. - Added app manifest and configuration files for logging and settings.
28 lines
1002 B
C#
28 lines
1002 B
C#
using Microsoft.AspNetCore.DataProtection;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace OTSSignsOrchestrator.Core.Data;
|
|
|
|
/// <summary>
|
|
/// Design-time factory for EF Core migrations tooling.
|
|
/// </summary>
|
|
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<XiboContext>
|
|
{
|
|
public XiboContext CreateDbContext(string[] args)
|
|
{
|
|
var optionsBuilder = new DbContextOptionsBuilder<XiboContext>();
|
|
optionsBuilder.UseSqlite("Data Source=design-time.db");
|
|
|
|
// Set up a temporary DataProtection provider for design-time use
|
|
var services = new ServiceCollection();
|
|
services.AddDataProtection()
|
|
.SetApplicationName("OTSSignsOrchestrator");
|
|
var sp = services.BuildServiceProvider();
|
|
var dpProvider = sp.GetRequiredService<IDataProtectionProvider>();
|
|
|
|
return new XiboContext(optionsBuilder.Options, dpProvider);
|
|
}
|
|
}
|