In this document
- -@Model.Document.Title
++ + + Modularity +
+Since ABP is a modular framework, every module defines it's services and registers to dependency injection in a seperated place, in it's own module class. Example:
+
+
+ public class BlogModule : AbpModule
+ {
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ //register dependencies here
+ }
+ }
+
+
+ + + + Conventional Registration +
+ABP introduces conventional service registration. You should do nothing to register services by convention. It's automatically done. If you want to disable it, you can set SkipAutoServiceRegistration to true by overriding the PreConfigureServices method.
+
+ {
+ public override void PreConfigureServices(ServiceConfigurationContext context)
+ {
+ SkipAutoServiceRegistration = true;
+ }
+ }
+
+
+ Once you skip auto registration, you should manually register your services. In that case, AddAssemblyOf extension method can help you to register all your services by convention. Example:
+
+ {
+ public override void PreConfigureServices(ServiceConfigurationContext context)
+ {
+ SkipAutoServiceRegistration = true;
+ }
+
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ context.Services.AddAssemblyOf< BlogModule >();
+ }
+ }
+
+
+ The section below explains the conventions and configurations.
+ + + + + ++ + + Inherently Registered Types +
+Some specific types are registered to dependency injection by default. Examples:
+-
+
- Module classes are registered as singleton. +
- MVC controllers (inherit
ControllerorAbpController) are registered as transient.
+ - MVC page models (inherit
PageModelorAbpPageModel) are registered as transient.
+ - MVC view components (inherit
ViewComponentorAbpViewComponent) are registered as transient.
+ - Application services (implement
IApplicationServiceinterface or inheritApplicationServiceclass) are registered as transient.
+ - Repositories (implement
IRepositoryinterface) are registered as transient.
+ - Domain services (implement
IDomainServiceinterface) are registered as transient.
+
Example:
+
+
+ public class BlogPostAppService : ApplicationService
+ {
+ }
+
+
+ BlogPostAppService is automatically registered with transient lifetime since it's derived from a known base class.
+ + + Dependency Interfaces +
+If you implement these interfaces, your class is registered to dependency injection automatically:
+-
+
ITransientDependencyto register with transient lifetime.
+ ISingletonDependencyto register with singleton lifetime.
+ IScopedDependencyto register with scoped lifetime.
+
Example:
+
+
+ public class TaxCalculator : ITransientDependency
+ {
+ }
+
+
+ TaxCalculator is automatically registered with transient lifetime since it implements ITransientDependency.
+ + + Dependency Attribute +
+Another way of configuring a service for dependency injection is to use DependencyAttribute. It has given properties:
-
+
Lifetime: Lifetime of the registration:Singleton,TransientorScoped.
+ TryRegister: Settrueto register the service only it's not registered before. Uses TryAdd... extension methods of IServiceCollection.
+ ReplaceServices: Settrueto replace services if they are already registered before. Uses Replace extension method of IServiceCollection.
+
Example:
+
+
+ public class TaxCalculator : ITransientDependency
+ {
+ }
+
+
+ Dependency attribute has higher priority then dependency interfaces if it defines the Lifetime property.
+ + + ExposeServices Attribute +
+ExposeServicesAttribute is used to control which services are provided by the related class. Example:
+
+ [ExposeServices(typeof(ITaxCalculator))]
+ public class TaxCalculator: ICalculator, ITaxCalculator, ICanCalculate, ITransientDependency
+ {
+ }
+
+
+
+
+
+
+## Wut? Poppers?
+
+A popper is an element on the screen which "pops out" from the natural flow of your application.
+Common examples of poppers are tooltips, popovers and drop-downs.
+
+
+## So, yet another tooltip library?
+
+Well, basically, **no**.
+Popper.js is a **positioning engine**, its purpose is to calculate the position of an element
+to make it possible to position it near a given reference element.
+
+The engine is completely modular and most of its features are implemented as **modifiers**
+(similar to middlewares or plugins).
+The whole code base is written in ES2015 and its features are automatically tested on real browsers thanks to [SauceLabs](https://saucelabs.com/) and [TravisCI](https://travis-ci.org/).
+
+Popper.js has zero dependencies. No jQuery, no LoDash, nothing.
+It's used by big companies like [Twitter in Bootstrap v4](https://getbootstrap.com/), [Microsoft in WebClipper](https://github.com/OneNoteDev/WebClipper) and [Atlassian in AtlasKit](https://aui-cdn.atlassian.com/atlaskit/registry/).
+
+### Popper.js
+
+This is the engine, the library that computes and, optionally, applies the styles to
+the poppers.
+
+Some of the key points are:
+
+- Position elements keeping them in their original DOM context (doesn't mess with your DOM!);
+- Allows to export the computed informations to integrate with React and other view libraries;
+- Supports Shadow DOM elements;
+- Completely customizable thanks to the modifiers based structure;
+
+Visit our [project page](https://fezvrasta.github.io/popper.js) to see a lot of examples of what you can do with Popper.js!
+
+Find [the documentation here](/docs/_includes/popper-documentation.md).
+
+
+### Tooltip.js
+
+Since lots of users just need a simple way to integrate powerful tooltips in their projects,
+we created **Tooltip.js**.
+It's a small library that makes it easy to automatically create tooltips using as engine Popper.js.
+Its API is almost identical to the famous tooltip system of Bootstrap, in this way it will be
+easy to integrate it in your projects.
+The tooltips generated by Tooltip.js are accessible thanks to the `aria` tags.
+
+Find [the documentation here](/docs/_includes/tooltip-documentation.md).
+
+
+## Installation
+Popper.js is available on the following package managers and CDNs:
+
+| Source | |
+|:-------|:---------------------------------------------------------------------------------|
+| npm | `npm install popper.js --save` |
+| yarn | `yarn add popper.js` |
+| NuGet | `PM> Install-Package popper.js` |
+| Bower | `bower install popper.js --save` |
+| unpkg | [`https://unpkg.com/popper.js`](https://unpkg.com/popper.js) |
+| cdnjs | [`https://cdnjs.com/libraries/popper.js`](https://cdnjs.com/libraries/popper.js) |
+
+Tooltip.js as well:
+
+| Source | |
+|:-------|:---------------------------------------------------------------------------------|
+| npm | `npm install tooltip.js --save` |
+| yarn | `yarn add tooltip.js` |
+| Bower* | `bower install tooltip.js=https://unpkg.com/tooltip.js --save` |
+| unpkg | [`https://unpkg.com/tooltip.js`](https://unpkg.com/tooltip.js) |
+| cdnjs | [`https://cdnjs.com/libraries/popper.js`](https://cdnjs.com/libraries/popper.js) |
+
+\*: Bower isn't officially supported, it can be used to install Tooltip.js only trough the unpkg.com CDN. This method has the limitation of not being able to define a specific version of the library. Bower and Popper.js suggests to use npm or Yarn for your projects.
+For more info, [read the related issue](https://github.com/FezVrasta/popper.js/issues/390).
+
+### Dist targets
+
+Popper.js is currently shipped with 3 targets in mind: UMD, ESM and ESNext.
+
+- UMD - Universal Module Definition: AMD, RequireJS and globals;
+- ESM - ES Modules: For webpack/Rollup or browser supporting the spec;
+- ESNext: Available in `dist/`, can be used with webpack and `babel-preset-env`;
+
+Make sure to use the right one for your needs. If you want to import it with a `