A powerful console application framework for .NET that provides auto-completion, command execution, and more.
$ dotnet add package SharpConsoleA powerful console application framework for .NET that provides auto-completion, command execution, and more.
Add the SharpConsole package to your console project:
dotnet add package SharpConsole
Here's how to use SharpConsole.Platform in your project:
public class CustomConsole : SharpConsoleBase
{
public string Name { get; set; }
public int Age { get; set; }
public string[] Tags { get; set; }
public AppDbContext db;
}
using Microsoft.EntityFrameworkCore;
using SharpConsole.Platform.Application;
using SharpConsole.Core.Entities;
var options = new DbContextOptionsBuilder<AppDbContext>()
.UseInMemoryDatabase(databaseName: "ExampleDb")
.Options;
using var context = new AppDbContext(options);
context.Users.Add(new User { Name = "Guga", Age = 38 });
context.Users.Add(new User { Name = "Bia", Age = 13 });
context.SaveChanges();
var console = new CustomConsole()
{
db = context,
Name = "Guga",
Age = 38,
Tags = new[] { "tag1", "tag2" }
};
console.Start();
Now you can interact with the console:
Name to see the valueAge to see the valueTags to see the arraydb.Users to see the database contextexit to quitTo help you get started quickly, we've created a comprehensive example project that demonstrates all the features of SharpConsole. The example includes:
You can find the example project at: SharpConsole.Examples
Contributions are welcome! Feel free to submit a Pull Request.
This project is licensed under a custom license based on the Apache License 2.0 with additional restrictions to protect the source code:
Please refer to the full license in the LICENSE file.
.examples folderThe files in this folder are provided solely for demonstration and learning purposes.
You may copy and adapt code snippets for your own projects, including commercial ones.
However, redistributing, forking, or publishing this folder as a whole or in derived form is prohibited without explicit permission from the author.
For more details, please see the main license file in the root repository.