MVVM Implementing started
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
static class AddConfigurationHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddConfiguration(this IHostBuilder hostBuilder)
|
||||
{
|
||||
hostBuilder.ConfigureAppConfiguration(c =>
|
||||
{
|
||||
c.AddJsonFile("appsettings.json");
|
||||
c.AddEnvironmentVariables();
|
||||
}
|
||||
);
|
||||
return hostBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
static class AddDBContextHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddDBContext(this IHostBuilder hostBuilder)
|
||||
{
|
||||
hostBuilder.ConfigureServices((context, services) =>
|
||||
{
|
||||
|
||||
});
|
||||
return hostBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SewerStammGen.Interface.Navigator;
|
||||
using SewerStammGen.ViewModel.State.Navigation;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
internal static class AddServicesHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddServices(this IHostBuilder host)
|
||||
{
|
||||
host.ConfigureServices(services =>
|
||||
{
|
||||
services.AddSingleton<IMainWindowNavigator, MainWindowNavigator>();
|
||||
});
|
||||
return host;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
SewerStammGen/HostBuilders/AddStoresHostBuilderExtensions.cs
Normal file
21
SewerStammGen/HostBuilders/AddStoresHostBuilderExtensions.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
static class AddStoresHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddStores(this IHostBuilder hostBuilder)
|
||||
{
|
||||
hostBuilder.ConfigureServices(services =>
|
||||
{
|
||||
|
||||
});
|
||||
return hostBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SewerStammGen.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
static class AddViewModelsHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddViewModels(this IHostBuilder hostBuilder)
|
||||
{
|
||||
hostBuilder.ConfigureServices(services =>
|
||||
{
|
||||
services.AddTransient<MainWindowViewModel>();
|
||||
});
|
||||
|
||||
return hostBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user