UssdStateMachine 3.0.5
See the version list below for details.
dotnet add package UssdStateMachine --version 3.0.5
NuGet\Install-Package UssdStateMachine -Version 3.0.5
<PackageReference Include="UssdStateMachine" Version="3.0.5" />
<PackageVersion Include="UssdStateMachine" Version="3.0.5" />
<PackageReference Include="UssdStateMachine" />
paket add UssdStateMachine --version 3.0.5
#r "nuget: UssdStateMachine, 3.0.5"
#addin nuget:?package=UssdStateMachine&version=3.0.5
#tool nuget:?package=UssdStateMachine&version=3.0.5
USSD State Machine
Introduction
This library provides a convenient way to integrate USSD functionality into your ASP.NET Core applications. Follow the steps below to get started.
Usage
Configure Redis Connection:
Ensure you have a Redis connection string named
Redis
in yourappsettings.json
file.{ "Redis": "your_redis_connection_string" }
Register USSD Dependencies:
In your
Startup.cs
file, add the following code within theConfigureServices
method.builder.Services.AddUSSDMenus();
Implement USSD in Controller:
Inject the
USSDService
into your controller, and call theProccessRequest<InitialMenu>()
function in your controller action.[Route("api/ussd")] [ApiController] public class USSDController : ControllerBase { private readonly USSDService _ussdService; public USSDController(USSDService ussdService) => _ussdService = ussdService; [HttpGet] public async Task Index([FromQuery] USSDRequest request) => await _ussdService.ProcessRequest<InitialMenu>(request); }
Creating Menus
To create menus, follow these steps:
Define Menu Class:
Create a class for your menu and decorate it with the
[USSDMenu]
attribute. Implement theIUSSDMenu
interface.[USSDMenu] public class InitialMenu : IUSSDMenu { public async Task DisplayAsync(USSDRequest request) { // Implement logic for displaying menu } public async Task ProcessInputAsync(USSDRequest request) { // Implement logic for processing user input } }
Utilize IUSSDMenuBuilder (Optional):
Inject the
IUSSDMenuBuilder
into your menu class to use the builder for implementing theDisplayAsync
andProcessInputAsync
methods.[USSDMenu] public class InitialMenu : IUSSDMenu { private readonly IUSSDMenuBuilder _builder; public InitialMenu(IUSSDMenuBuilder builder) => _builder = builder; public async Task DisplayAsync(USSDRequest request) { // Implement logic using the IUSSDMenuBuilder } public async Task ProcessInputAsync(USSDRequest request) { // Implement logic using the IUSSDMenuBuilder } }
Feel free to customize the logic within the menu classes to suit your USSD application requirements.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net7.0
- Serilog (>= 3.0.1)
- Serilog.AspNetCore (>= 7.0.0)
- Serilog.Sinks.Console (>= 4.1.0)
- StackExchange.Redis (>= 2.6.122)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
5.5.0-alpha.1 | 131 | 4/7/2025 |
5.4.0-alpha.1 | 101 | 5/23/2024 |
5.3.2 | 151 | 3/27/2024 |
5.3.1 | 112 | 3/27/2024 |
5.3.0 | 128 | 3/20/2024 |
5.2.0 | 152 | 1/17/2024 |
5.0.14 | 127 | 1/15/2024 |
5.0.13 | 118 | 1/15/2024 |
5.0.12 | 120 | 1/15/2024 |
5.0.11 | 125 | 1/15/2024 |
5.0.1 | 131 | 1/12/2024 |
5.0.0 | 128 | 1/12/2024 |
4.0.3-alpha.3 | 3,299 | 7/23/2024 |
4.0.3-alpha.2 | 61 | 7/23/2024 |
4.0.3-alpha.1 | 771 | 5/29/2024 |
4.0.2 | 1,684 | 12/14/2023 |
4.0.1 | 140 | 12/13/2023 |
4.0.0 | 154 | 12/13/2023 |
3.0.5 | 409 | 10/27/2023 |
3.0.4 | 155 | 10/27/2023 |
3.0.0 | 136 | 10/10/2023 |
1.0.0 | 235 | 9/19/2023 |