DiterionLabs.USSD 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package DiterionLabs.USSD --version 1.0.3
                    
NuGet\Install-Package DiterionLabs.USSD -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DiterionLabs.USSD" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DiterionLabs.USSD" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="DiterionLabs.USSD" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DiterionLabs.USSD --version 1.0.3
                    
#r "nuget: DiterionLabs.USSD, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DiterionLabs.USSD@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DiterionLabs.USSD&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=DiterionLabs.USSD&version=1.0.3
                    
Install as a Cake Tool

Diterion Labs USSD Library

Usage

  1. Have a redis connection string in your appsettings.json with name Redis

  2. Register the USSD dependences in your Startup.cs

builder.Services.AddUSSDMenus();
  1. In your controller, inject the USSDService and call the ProccessRequest<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

Menus should have a [USSDMenu] attribute and implement the IUSSDMenu interface.


[USSDMenu]
public class InitialMenu : IUSSDMenu
{
    public async Task DisplayAsync(USSDRequest request)
    {
        // Implement logic
    }

    public async Task ProcessInputAsync(USSDRequest request)
    {
        // Implement logic
    }
}

To implement the DisplayAsync and the ProcessInputAsync, you can make use of the IUSSDMenuBuilder which can be injected in the menu class

[USSDMenu]
public class InitialMenu : IUSSDMenu
{
    private readonly IUSSDMenuBuilder _builder;
    public InitialMenu(IUSSDMenuBuilder builder) => 
        _builder = builder;

    public async Task DisplayAsync(USSDRequest request)
    {
        // Implement logic
    }

    public async Task ProcessInputAsync(USSDRequest request)
    {
        // Implement logic
    }
}
Product 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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.6 499 4/18/2023
1.1.5 252 4/18/2023
1.1.4 257 4/18/2023
1.1.3 268 4/17/2023
1.1.2 246 4/17/2023
1.1.0 252 4/17/2023
1.0.9 256 4/17/2023
1.0.7 255 4/17/2023
1.0.6 264 4/14/2023
1.0.5 256 4/14/2023
1.0.4 263 4/13/2023
1.0.3 384 1/20/2023
1.0.2 367 1/20/2023
1.0.1 361 1/20/2023
1.0.0 364 1/20/2023