What is Dependency Injection If you already know Dependency Injection concept, Constructor and Property Injection patterns, you can skip to the next section. Wikipedia says: "Dependency injection is a software design pattern in which one or more depe…
In C#, a class can define own events and other classes can register it to be notified when something happen. This is useful for a desktop application or standalone windows service. But, for a web application it's a bit problematic since objects are c…
Introduction Hangfire is a compherensive background job manager. You can integrate ASP.NET Boilerplate with Hangfire to use it instead of default background job manager. You can use the same background job API for Hangfire. Thus, your code will be in…
Introduction Email sending is a pretty common task for almost every application. ASP.NET Boilerplate provides a basic infrastructure to simply send emails and seperate email server configuration from sending emails. IEmailSender IEmailSender is a ser…
Building Dynamic Web API Controllers This document is for ASP.NET Web API. If you're interested in ASP.NET Core, see ASP.NET Core documentation. ASP.NET Boilerplate can automatically generate ASP.NET Web API layer for your application layer. Say that…
Introduction This document is for ASP.NET MVC and Web API. If you're interested in ASP.NET Core, see ASP.NET Core documentation. In a web application, exceptions are usually handled in MVC Controller actions and Web API Controller actions. When an ex…
Introduction ASP.NET Boilerplate provides an easy way of using embedded Razor views (.cshtml files) and other resources (css, js, img... files) in your web application. You can use this feature to create plugins/modules that contains UI functionality…
一:这里先说一下DI(Dependency Injection)依赖注入有种表现形式:一种是CI(Constructor Injection)构造方法注入,另一种是SI(Set Injection) set 注入.这篇随笔讲的是第一种构造方法注入(Constructor Injection). 其实DI(Dependency Injection)依赖注入你不妨反过来读:注入依赖也就是把"依赖"注入到一个对象中去.那么何为"依赖"呢?依赖就是讲一个对象初始化或者将实例…
Introduction Most SaaS (multi-tenant) applications have editions (packages) those have different features. Thus, they can provide different price and feature options to thier tenants (customers). ASP.NET Boilerplate provides a feature system to make…
Introduction Domain Services (or just Service, in DDD) is used to perform domain operations and business rules. Eric Evans describes a good Service in three characteristics (in his DDD book): The operation relates to a domain concept that is not a na…
这篇文章主要讲解asp.net core 依赖注入的一些内容. ASP.NET Core支持依赖注入.这是一种在类和其依赖之间实现控制反转的一种技术(IOC). 一.依赖注入概述 1.原始的代码 依赖就是一个对象的创建需要另一个对象.下面的MyDependency是应用中其他类需要的依赖: public class MyDependency { public MyDependency() { } public Task WriteMessage(string message) { Console…
小结: 1. Dependency Injection is merely one concrete example of Inversion of Control. 依赖注入是仅仅是控制反转的一个具体例子. 2. Dependency Injection helps in gluing these classes together and at the same time keeping them independent. 依赖注入既使类粘合又使类分离. 3. For example, cla…
DI:中文名称:依赖注入 英文名称((Dependency Injection) DI 是什么? 3.1 DI 和IoC 是一样的,差不多一样的技术和模板! 3.2 当一个类(A)中需要依赖另一个类(B)对象时,把 B 赋值给A 的过程就叫做依赖注入. 4.代码体现: (添加一个desk类,并且添加进People属性内) 4.1 添加desk bean类 : private int id; private double price; package com02.bean; public clas…
Introduction(介绍) Abp.EntityFrameworkCore nuget package is used to integrate to Entity Framework (EF) Core ORM framework. After installing this package, we should also add a DependsOn attribute for AbpEntityFrameworkCoreModule. abp.entityframeworkcore…
Introduction While our default templates designed to work with SQL Server, you can easily modify them to work with MySql. In order to do that, you need to follow below steps. Download Project Go to http://aspnetboilerplate.com/Templates and download…
Person类中的各种属性写法如下: package com.swift.person; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Properties; public class Person { //普通字符串 private String name; //字符串数组 private String[] arr; //字符串列表 private List<Stri…
注解方式xml里面就不需要注册bean了. 构建注解需要 1.导入spring-aop-4.2.1.RELEASE.jar 包  2.需要更换配置文件头,即添加相应的约束. 现在的Student类就要这样定义了,如下图 下面的Student类的School注入是以jdk方式的注入(javax.annotation.Resource 是jdk里面的类) xml配置如下(就下面的一句话<context:component-scan base-package="com.bjpowernode.d…
原文:黄聪:Microsoft Enterprise Library 5.0 系列教程(八) Unity Dependency Injection and Interception 依赖注入容器Unity: Unity的构造类似于Castle中的IOC(控制反转 或者叫依赖注入)容器,我们使用抽象接口来隔离使用者和具体实现之间的依赖关系,但是不管再怎么抽象,最终还是要创建具体实现类的实例,这种创建具体实现类的实例对象就会造成对于具体实现的依赖,为了消除这 种创建依赖性,需要把依赖移出到程序的外部…
老周的ABP框架系列教程 -- 一.框架理论初步学习   1. ABP框架的来源与作用简介 1.1  简介 1.1.1       ABP框架全称为"ASP.NET Boilerplate Project",中文翻译为" ASP.NET样板项目",诞生的主要目的就是为了让.NET程序员"秒变"架构师,将.NET企业级项目的主流开发技术.最先进的架构整合起来,让.NET工程师能够更快的开发出更好的项目. 1.1.2       ABP官方网站:ht…
2019 年起如何开始学习 ABP 框架系列文章-开篇有益 [[TOC]] 本系列文章推荐阅读地址为:52ABP 开发文档 https://www.52abp.com/Wiki/52abp/latest/Welcome-to-52abp 本文的目的是为了让刚刚接触 ABP 框架的同学或者准备接触 ABP 框架的同学,能够理解和搞明白 ABP 框架到底是怎么回事,毕竟它发展了好几年的时间.社区中有很多人做 了 ABP 的资料和文章包括我自己也建立了 52ABP,社区中还有 ABPplus 等等的内…
Java 设计模式系列(二十)状态模式 状态模式,又称状态对象模式(Pattern of Objects for States),状态模式是对象的行为模式.状态模式允许一个对象在其内部状态改变的时候改变其行为.这个对象看上去就像是改变了它的类一样. 一.状态模式的结构 用一句话来表述,状态模式把所研究的对象的行为包装在不同的状态对象里,每一个状态对象都属于一个抽象状态类的一个子类.状态模式的意图是让一个对象在其内部状态改变的时候,其行为也随之改变.状态模式的示意性类图如下所示: Context:…
目录 go微服务框架kratos学习笔记八(kratos的依赖注入) 什么是依赖注入 google wire kratos中的wire Providers injector(注入器) Binding Interfaces go微服务框架kratos学习笔记八(kratos的依赖注入) 笔记二提过依赖注入,和如何生成,但没有细讲,本文来简单看看kratos的依赖注入. 什么是依赖注入 来看一个小程序, 创建一个小程序模拟带有问候的事件 我们将创建三个结构类型: 1)为迎宾员创建消息 message…
Server Side(服务端) ASP.NET Boilerplate uses Castle Windsor's logging facility. It can work with different logging libraries: Log4Net, NLog, Serilog... etc. Castle provides a common interface for all logger libraries. So, you're independent from specifi…
Introduction It's a common to map a similar object to another object. It's also tedious and repeating since generally both objects (classes) may have similar/same properties mapped to each other. Think on a typical application servicemethod below: 将相…
ASP.NET Boilerplate provides an infrastructure and a model to configure it and modules on startup. ASP.NET提供了一个基础和样板模型配置和模块启动. Configuring ASP.NET Boilerplate Configuring ASP.NET Boilerplate is made on PreInitialize event of your module. Example conf…
Introduction Every application need to store some settings and use these settings in somewhere in the application. ASP.NET Boilerplate provides a strong infrastructure to store/retrieve application, tenant and user level settings usable both in serve…
Application Services are used to expose domain logic to the presentation layer. An Application Service is called from presentation layer with a DTO (Data Transfer Object) as parameter, uses domain objects to perform some specific business logic and r…
Introduction ASP.NET Boilerplate is integrated to ASP.NET MVC Controllers via Abp.Web.Mvc nuget package. You can create regular MVC Controllers as you always do. Dependency Injection properly works for regular MVC Controllers. But you should derive y…
本文是ABP核心项目源码分析的最后一篇,介绍一些前面遗漏的功能 AbpSession AbpSession: 目前这个和CLR的Session没有什么直接的联系.当然可以自定义的去实现IAbpSession使之与CLR的Session关联 IAbpSession:定义如下图中的四个属性. NullAbpSession:IAbpSession的一个缺省实现,给每个属性都给予null值,无实际作用 ClaimsAbpSession:实现了从ClaimsPrincipal/ClaimsIdentity…
What Is Multi Tenancy? "Software Multitenancy refers to a software architecture in which a single instance of a software runs on a server and serves multiple tenants. A tenant is a group of users who share a common access with specific privileges to…