Using .Net Console with fluent builder interface with many extension methods.


Keywords
console, csharp, dotnet, net7, net6, net48, fluent, helper, c#, console-app, console-application, console-tool, dotnetcore, helpers
License
MIT
Install
Install-Package FluentConsole.Net -Version 1.0.8568

Documentation

Nuget Code Smells Maintainability Rating Security Rating Bugs Vulnerabilities Lines of Code Duplicated Lines (%) Reliability Rating License

FluentConsole.Net

Using .Net Console In Elegant Way !

Easy to use and develop , clean code , and also designed to be fully thread-safe.

FluentConsole.Net uses fluent builder pattern.

FluentConsole.Net has fluent extension methods to write directly on Console.

FluentConsole.Net is able to use FastLog.Net logger to also log the data when printing on the Console.


Screen Shots

FluentConsole.Net Sample

FluentConsole.Net For .Net


Contributions 🤝

Since this is a new repository , there's no contributor yet! , But FluentConsole.Net welcomes and appreciates any contribution , pull request or bug report.


How To Use

  • An elegant fluent builder pattern to work with Console 👇
FluentConsole.Console
             .WithFontColor(ConsoleColor.Yellow)
             .WithBackColor(ConsoleColor.DarkGray)
             .Write(DateTime.Now.ToString())
             .AddSpace()
             .WriteLine("Fluent Console For .Net")
             .AddCharacter('*', 20)
             .AddBreakLine(2)
             .WriteLine("Developed By Shayan Firoozi")
             .Print();
  • Another Example with FastLog.Net , high performance logger 👇
   FluentConsole.AttachLogger(fastLogger);

   FluentConsole.Console
                   .WithTitle("This is the Fluent Console For .Net")
                   .WithFontColor(ConsoleColor.Yellow)
                   .AddLine(LineWidth: 20)
                   .Write("Who wants to live forever ?!")
                   .Beep()
                   .PrintAndLog();
  • Also u can easily use built-in Extension Methods 👇
1364.WriteLineOnConsole(Formatted: true);
true.WriteLineOnConsole();
false.WriteLineOnConsole(YesNoFormat: true);

// Also for List<string>
List<string> greatest = new List<string>() { "David Gilmour", "Joe Satriani", "Stevie Ray Vaughan", "Slash !", "Paul Mccartney" };
greatest.WriteLineOnConsole();


// Printing your Exception object as easy as hell !

new InvalidOperationException("This a test exception I want to throw !!").WriteLineOnConsoleWithJSON();

new InvalidOperationException("This a test exception I want to throw !!").WriteLineOnConsole();


// Print DateTime object in proper and also optional format on console

FluentConsole.Console.WriteLine(DateTime.Now).Print();

FluentConsole.Console.WriteLine(DateTime.Now,"HH:mm:ss").Print();
  • FastConsole methods 👇
FastConsole.PrintText("This is a Normal text !\n");

FastConsole.PrintInfo("This is an Info text !\n");

FastConsole.PrintNote("This is a Note text !\n");

FastConsole.PrintTodo("This is a Todo text !\n");

FastConsole.PrintWarning("This is a Warning message !\n");

FastConsole.PrintAlert("This is an Alert message !\n");

FastConsole.PrintDebug("This is a Debug message !\n");

FastConsole.PrintError("This is an Error message !\n");

FastConsole.PrintException(new InvalidCastException("This is a test Exception from \"FluentConsole.Net\"\n"));

FastConsole.PrintSystem("This is a System message!\n");

FastConsole.PrintSecurity("This is a Security message!\n");
  • Symbolic Print with Style methods 👇
FluentConsole.FastConsole.PrintSymbolicText("I AM A STYLISH TEXT", FontStyle.StyleA, ConsoleColor.DarkCyan);

Known Issues

Not Reported Yet! 😎


License ©

FluentConsole.Net is an open source software, licensed under the terms of MIT license. See LICENSE for more details.


How to build 🛠

Use Visual Studio 2022 and open the solution 'FluentConsole.sln'.

FluentConsole.Net solution is setup to support following .Net versions :

  • .Net Core 7.0
  • .Net Core 6.0
  • .Net Framework 4.8

Note:
Since the FluentConsole.Net solution is supporting multi target frameworks , to build the solution successfully you should install all .Net versions above , otherwise you can easily exclude not interested framework(s) by editing TargetFrameworks tag in the FluentConsole.Net Project File.


Donations 💲

If you would like to financially support FluentConsole.Net, first of all, thank you! Please read DONATIONS for my crypto wallets !


Version History 🕙

Please read CHANGELOG for more and track changing details.