SolidPrinciplesDemo 1.0.0
dotnet add package SolidPrinciplesDemo --version 1.0.0
NuGet\Install-Package SolidPrinciplesDemo -Version 1.0.0
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="SolidPrinciplesDemo" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SolidPrinciplesDemo --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SolidPrinciplesDemo, 1.0.0"
#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 SolidPrinciplesDemo as a Cake Addin #addin nuget:?package=SolidPrinciplesDemo&version=1.0.0 // Install SolidPrinciplesDemo as a Cake Tool #tool nuget:?package=SolidPrinciplesDemo&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SolidPrinciplesDemo
SolidPrinciplesDemo is a C# library that demonstrates the SOLID principles of object-oriented design through report generation and formatting. The library provides functionalities for creating reports, formatting them in different styles (plain text and HTML), and printing them to the console.
Features
- Report Creation: Create reports with titles and content.
- Formatting Options: Format reports in plain text or HTML.
- Printing: Print reports to the console using different formatting options.
- Shape Calculations: Calculate areas of different shapes (Rectangle and Circle).
Installation
You can install the library via NuGet Package Manager. Use the following command in your Package Manager Console:
Install-Package SolidPrinciplesDemo
Or, if you're using the .NET CLI, run:
dotnet add package SolidPrinciplesDemo
usage
using SolidPrinciplesDemo;
class Program
{
static void Main(string[] args)
{
// Create a report
var report = new Report("Monthly Sales", "The total sales for this month are $10,000.");
// Create formatter and printer
IReportFormatter formatter = new PlainTextFormatter();
IPrinter printer = new ConsolePrinter();
// Create a report service
var reportService = new ReportService(printer, formatter);
// Generate and print the report
reportService.GenerateReport(report);
}
}
using SolidPrinciplesDemo;
class Program
{
static void Main(string[] args)
{
// Create a report
var report = new Report("Monthly Sales", "The total sales for this month are $10,000.");
// Create HTML formatter and printer
IReportFormatter formatter = new HtmlFormatter();
IPrinter printer = new ConsolePrinter();
// Create a report service
var reportService = new ReportService(printer, formatter);
// Generate and print the report
reportService.GenerateReport(report);
}
}
using SolidPrinciplesDemo;
class Program
{
static void Main(string[] args)
{
// Create a rectangle and calculate its area
Shape rectangle = new Rectangle(5, 10);
Console.WriteLine($"Area of Rectangle: {rectangle.Area()}");
// Create a circle and calculate its area
Shape circle = new Circle(3);
Console.WriteLine($"Area of Circle: {circle.Area()}");
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- No dependencies.
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.0.0 | 94 | 11/15/2024 |