标签:
一 环境 ASP.Net 5 安装方法:http://www.nuget.org/packages/Microsoft.AspNet.Mvc/5.2.3 二 相关资料 Asp.net MVC资料 http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application http://www.cnblogs.com/powertoolsteam/archive/2013/11/12/aspnet-mvc5-getting-started.html EntityFramework: https://msdn.microsoft.com/zh-cn/data/ee712907 依赖注入Autofac 文档 http://kb.cnblogs.com/page/45266/ http://docs.autofac.org/en/latest/ Automaper 资料 http://www.cnblogs.com/dudu/archive/2011/12/16/2284828.html 后台UI框架 kendo ui http://demos.telerik.com/kendo-ui/ NopCommerce 资料 http://www.nopchina.net/ http://www.nopcommerce.com/ https://github.com/nuodb/nopCommerce 在NopCommerce中新增一个Domain Model,需要以下几个步骤: 1. 新建一个Entity Class (Nop/Core/Domain/Entity.cs) 以多语言为例: 2. 新建一个Mapping Class (Nop/Data/Mapping/EntityMap.cs) 3. 新建一个View Model (Nop/Admin/Models/EntityModel.cs 或 Nop/Web/Models/EntityModel.cs) 4. 新建Model Validator (Nop/Admin/Validators/EntityValidator.cs 或 Nop/Web/Validators/EntityValidator.cs) 5. 为AutoMapper新建映射配置,用来完成Model和Entity之间的转换 (Nop/Admin/Infrastructure/AutoMapperStartupTask.cs 或 Nop/Web/Infrastructure/AutoMapperStartupTask.cs) 6. 编写ToModel和ToEntity (Nop/Admin/MappingExtensions.cs 或 Nop/Web/MappingExtensions.cs) 7. 创建Service和Service Interface (Nop/Services/EntityService.cs 和 Nop/Services/IEntityService.cs) 8. 最后新建的Model创建Controller和View 9 依赖注入框架注册 . Nop.Web.FrameWork/ DependencyRegistrar.cs: builder.RegisterType<EntityService>().As<IEntityService>().InstancePerHttpRequest();
标签:
原文地址:http://www.cnblogs.com/iwyc/p/4682375.html