This commit is contained in:
yubaolee
2017-11-29 10:35:25 +08:00
parent c860101747
commit 3fa7422f5a
8 changed files with 9 additions and 25 deletions

View File

@@ -9,12 +9,13 @@
// File: AuthenService.cs
// ***********************************************************************
using OpenAuth.Domain.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using OpenAuth.Domain;
using OpenAuth.Domain.Interface;
namespace OpenAuth.Domain.Service
namespace OpenAuth.App
{
/// <summary>
/// 领域服务

View File

@@ -3,7 +3,6 @@ using Infrastructure;
using OpenAuth.App.ViewModel;
using OpenAuth.Domain;
using OpenAuth.Domain.Interface;
using OpenAuth.Domain.Service;
namespace OpenAuth.App
{

View File

@@ -1,7 +1,6 @@
using OpenAuth.Domain;
using System.Collections.Generic;
using OpenAuth.Domain.Interface;
using OpenAuth.Domain.Service;
namespace OpenAuth.App
{

View File

@@ -9,12 +9,10 @@
// File: AuthenService.cs
// ***********************************************************************
using OpenAuth.Domain.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using OpenAuth.Domain;
namespace OpenAuth.Domain.Service
namespace OpenAuth.App
{
/// <summary>
/// 领域服务

View File

@@ -8,7 +8,6 @@ using OpenAuth.App;
using OpenAuth.App.SSO;
using OpenAuth.App.ViewModel;
using OpenAuth.Domain;
using OpenAuth.Domain.Service;
using OpenAuth.Mvc.Controllers;
namespace OpenAuth.Mvc.Areas.FlowManage.Controllers

View File

@@ -1,11 +1,9 @@
using System.Reflection;
using System.Web.Mvc;
using Autofac;
using Autofac.Configuration;
using Autofac.Integration.Mvc;
using OpenAuth.App;
using OpenAuth.Domain.Interface;
using OpenAuth.Domain.Service;
using OpenAuth.Repository;
namespace OpenAuth.UnitTest

View File

@@ -1,11 +1,8 @@
using System;
using System.Diagnostics;
using System.Diagnostics;
using System.Linq;
using Infrastructure;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenAuth.App;
using OpenAuth.Domain.Service;
using OpenAuth.Repository;
namespace OpenAuth.UnitTest
{

View File

@@ -19,7 +19,6 @@ using Autofac.Configuration;
using Autofac.Integration.Mvc;
using OpenAuth.App;
using OpenAuth.Domain.Interface;
using OpenAuth.Domain.Service;
using OpenAuth.Repository;
namespace OpenAuth.WebApi
@@ -31,18 +30,12 @@ namespace OpenAuth.WebApi
var builder = new ContainerBuilder();
//注册数据库基础操作和工作单元
builder.RegisterGeneric(typeof(BaseRepository<>)).As(typeof(IRepository<>));
builder.RegisterType(typeof (UnitWork)).As(typeof (IUnitWork));
//注册WebConfig中的配置
builder.RegisterModule(new ConfigurationSettingsReader("autofac"));
builder.RegisterGeneric(typeof(BaseRepository<>)).As(typeof(IRepository<>)).PropertiesAutowired();
builder.RegisterType(typeof (UnitWork)).As(typeof (IUnitWork)).PropertiesAutowired();
//注册app层
builder.RegisterAssemblyTypes(Assembly.GetAssembly(typeof (AuthorizeApp)));
builder.RegisterAssemblyTypes(Assembly.GetAssembly(typeof (AuthorizeApp))).PropertiesAutowired();
//注册领域服务
builder.RegisterAssemblyTypes(Assembly.GetAssembly(typeof(AuthoriseService)))
.Where(u =>u.Namespace== "OpenAuth.Domain.Service");
// OPTIONAL: Register model binders that require DI.
builder.RegisterModelBinders(Assembly.GetExecutingAssembly());