Book Image

Mastering ABP Framework

By : Halil İbrahim Kalkan
Book Image

Mastering ABP Framework

By: Halil İbrahim Kalkan

Overview of this book

ABP Framework is a complete infrastructure for creating modern web applications by following software development best practices and conventions. With ABP's high-level framework and ecosystem, you can implement the Don’t Repeat Yourself (DRY) principle and focus on your business code. Written by the creator of ABP Framework, this book will help you to gain a complete understanding of the framework and modern web application development techniques. With step-by-step explanations of essential concepts and practical examples, you'll understand the requirements of a modern web solution and how ABP Framework makes it enjoyable to develop your own solutions. You'll discover the common requirements of enterprise web application development and explore the infrastructure provided by ABP. Throughout the book, you’ll get to grips with software development best practices for building maintainable and modular web solutions. By the end of this book, you'll be able to create a complete web solution that is easy to develop, maintain, and test.
Table of Contents (24 chapters)
1
Part 1: Introduction
6
Part 2: Fundamentals of ABP Framework
11
Part 3: Implementing Domain–Driven Design
15
Part 4: User Interface and API Development
19
Part 5: Miscellaneous

Implementing the options pattern

With the options pattern, we use a plain class (sometimes called a POCOPlain Old C# Object) to define a group of related options. Let's begin with how to define, configure, and use the configuration using the options pattern.

Defining an options class

An options class is a simple plain C# class. We can define an options class for the Azure SMS service as shown in the following code block:

public class AzureSmsServiceOptions
{
    public string Sender { get; set; }
    public string ConnectionString { get; set; }
}

It is a convention to add the Options suffix to options classes. Once you define such a class, any module using this service can configure the options easily.

Configuring the options

As mentioned in the ABP modules section, you can configure the services of the dependent modules in the ConfigureServices method of your module. We use the IServiceCollection.Configure extension...