DiterionLabs.USSD
1.0.3
There is a newer version of this package available.
See the version list below for details.
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.
paket add DiterionLabs.USSD --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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.
// Install DiterionLabs.USSD as a Cake Addin
#addin nuget:?package=DiterionLabs.USSD&version=1.0.3
// Install DiterionLabs.USSD as a Cake Tool
#tool nuget:?package=DiterionLabs.USSD&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Diterion Labs USSD Library
Usage
Have a redis connection string in your
appsettings.json
with nameRedis
Register the USSD dependences in your
Startup.cs
builder.Services.AddUSSDMenus();
- In your controller, inject the
USSDService
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
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 | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- LanguageExt.Core (>= 4.4.0)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 7.0.0)
- Serilog (>= 2.12.0)
- Serilog.AspNetCore (>= 6.1.0)
- StackExchange.Redis (>= 2.6.86)
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 | 268 | 4/18/2023 |
1.1.5 | 153 | 4/18/2023 |
1.1.4 | 156 | 4/18/2023 |
1.1.3 | 167 | 4/17/2023 |
1.1.2 | 148 | 4/17/2023 |
1.1.0 | 148 | 4/17/2023 |
1.0.9 | 154 | 4/17/2023 |
1.0.7 | 159 | 4/17/2023 |
1.0.6 | 161 | 4/14/2023 |
1.0.5 | 154 | 4/14/2023 |
1.0.4 | 162 | 4/13/2023 |
1.0.3 | 281 | 1/20/2023 |
1.0.2 | 262 | 1/20/2023 |
1.0.1 | 258 | 1/20/2023 |
1.0.0 | 260 | 1/20/2023 |