From 3fa7422f5ad39cba01c77b1309b31621f922aad8 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Wed, 29 Nov 2017 10:35:25 +0800 Subject: [PATCH] RU --- OpenAuth.App/AuthoriseService.cs | 5 +++-- OpenAuth.App/AuthorizeApp.cs | 1 - OpenAuth.App/ModuleManagerApp.cs | 1 - OpenAuth.App/SystemAuthService.cs | 6 ++---- .../FlowManage/Controllers/FlowDesignController.cs | 1 - OpenAuth.UnitTest/AutofacExt.cs | 2 -- OpenAuth.UnitTest/TestAuthen.cs | 5 +---- OpenAuth.WebApi/AutofacExt.cs | 13 +++---------- 8 files changed, 9 insertions(+), 25 deletions(-) diff --git a/OpenAuth.App/AuthoriseService.cs b/OpenAuth.App/AuthoriseService.cs index 5fe6efff..c3ae0dde 100644 --- a/OpenAuth.App/AuthoriseService.cs +++ b/OpenAuth.App/AuthoriseService.cs @@ -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 { /// /// 领域服务 diff --git a/OpenAuth.App/AuthorizeApp.cs b/OpenAuth.App/AuthorizeApp.cs index a710e24d..602d0d23 100644 --- a/OpenAuth.App/AuthorizeApp.cs +++ b/OpenAuth.App/AuthorizeApp.cs @@ -3,7 +3,6 @@ using Infrastructure; using OpenAuth.App.ViewModel; using OpenAuth.Domain; using OpenAuth.Domain.Interface; -using OpenAuth.Domain.Service; namespace OpenAuth.App { diff --git a/OpenAuth.App/ModuleManagerApp.cs b/OpenAuth.App/ModuleManagerApp.cs index 7ecfd5c8..fb64db69 100644 --- a/OpenAuth.App/ModuleManagerApp.cs +++ b/OpenAuth.App/ModuleManagerApp.cs @@ -1,7 +1,6 @@ using OpenAuth.Domain; using System.Collections.Generic; using OpenAuth.Domain.Interface; -using OpenAuth.Domain.Service; namespace OpenAuth.App { diff --git a/OpenAuth.App/SystemAuthService.cs b/OpenAuth.App/SystemAuthService.cs index 7bef0908..d86b4fca 100644 --- a/OpenAuth.App/SystemAuthService.cs +++ b/OpenAuth.App/SystemAuthService.cs @@ -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 { /// /// 领域服务 diff --git a/OpenAuth.Mvc/Areas/FlowManage/Controllers/FlowDesignController.cs b/OpenAuth.Mvc/Areas/FlowManage/Controllers/FlowDesignController.cs index 43e0536d..164df92b 100644 --- a/OpenAuth.Mvc/Areas/FlowManage/Controllers/FlowDesignController.cs +++ b/OpenAuth.Mvc/Areas/FlowManage/Controllers/FlowDesignController.cs @@ -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 diff --git a/OpenAuth.UnitTest/AutofacExt.cs b/OpenAuth.UnitTest/AutofacExt.cs index 2482e796..32e80e95 100644 --- a/OpenAuth.UnitTest/AutofacExt.cs +++ b/OpenAuth.UnitTest/AutofacExt.cs @@ -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 diff --git a/OpenAuth.UnitTest/TestAuthen.cs b/OpenAuth.UnitTest/TestAuthen.cs index 6b97efaf..d7e7c845 100644 --- a/OpenAuth.UnitTest/TestAuthen.cs +++ b/OpenAuth.UnitTest/TestAuthen.cs @@ -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 { diff --git a/OpenAuth.WebApi/AutofacExt.cs b/OpenAuth.WebApi/AutofacExt.cs index aa290f84..c590b825 100644 --- a/OpenAuth.WebApi/AutofacExt.cs +++ b/OpenAuth.WebApi/AutofacExt.cs @@ -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());