Add project files.
This commit is contained in:
40
StockInfo/Program.cs
Normal file
40
StockInfo/Program.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using Autofac;
|
||||
using StockDal;
|
||||
using StockDal.Interface;
|
||||
using StockDAL;
|
||||
using StockDAL.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace StockInfo
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
public static IContainer Container;
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.SetHighDpiMode(HighDpiMode.SystemAware);
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Container = Configure();
|
||||
Application.Run(new frmInitial( Container.Resolve<IStockRepository>(), Container.Resolve<IStockMarketRepository>()));
|
||||
}
|
||||
|
||||
static IContainer Configure()
|
||||
{
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterType<StockRepository>().As<IStockRepository>();
|
||||
builder.RegisterType<StockMarketRepository>().As<IStockMarketRepository>();
|
||||
builder.RegisterType<frmInitial>();
|
||||
return builder.Build();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user