diff --git a/CrispyWaffle.csproj b/CrispyWaffle.csproj new file mode 100644 index 00000000..042155e8 --- /dev/null +++ b/CrispyWaffle.csproj @@ -0,0 +1,2 @@ +- 1.0.0 + 1.1.0 \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index d00835a2..95e6597d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,7 +15,7 @@ true true snupkg - 1.0.0 + 1.1.0 1.0.0.0 logo.png LICENSE diff --git a/Directory.Packages.props b/Directory.Packages.props index ac6ac463..d497f3b9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -34,4 +34,5 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - \ No newline at end of file + + diff --git a/README.md b/README.md index 0e3aea72..7b9675cf 100644 --- a/README.md +++ b/README.md @@ -1,134 +1,144 @@ -# Crispy Waffle - -🧰 🛠️ Crispy Waffle project - a toolkit for .NET projects. - -[![GitHub license](https://img.shields.io/github/license/guibranco/CrispyWaffle)](https://github.com/guibranco/CrispyWaffle) -[![Time tracker](https://wakatime.com/badge/github/guibranco/CrispyWaffle.svg)](https://wakatime.com/badge/github/guibranco/CrispyWaffle) - -![Crispy Waffle logo](https://raw.githubusercontent.com/guibranco/CrispyWaffle/main/logo.png) - -Documentation: [Read the Docs](https://guibranco.github.io/CrispyWaffle/) - ---- - -## Table of content - -- [CI/CD](#cicd): Current project status in the build pipeline (AppVeyor). -- [Code Quality](#code-quality): Metrics from some tools about code quality. -- [.NET support](#.NET-support): Supported .NET version. -- [Installation](#installation): How to install/download this tool. -- [User guide](#user-guide): How to set up, configure and use this tool. -- [Change log](#changelog): Changelog containing the changes done in this project. -- [Support](#support): How to get support. -- [Contributing](#contributing): How to contribute. - ---- - -## CI/CD - -| Build status | Last commit | Tests | Coverage | Code Smells | LoC | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [![Build status](https://ci.appveyor.com/api/projects/status/dr93gad0na076ng3/branch/main?svg=true)](https://ci.appveyor.com/project/guibranco/crispywaffle/branch/main) | [![GitHub last commit](https://img.shields.io/github/last-commit/guibranco/CrispyWaffle/main)](https://github.com/guibranco/CrispyWaffle) | [![AppVeyor tests (branch)](https://img.shields.io/appveyor/tests/guibranco/crispywaffle/main?compact_message)](https://ci.appveyor.com/project/guibranco/crispywaffle/branch/main/tests) | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=coverage)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) | [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=code_smells)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) | [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=ncloc)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) | - ---- - -## Code Quality - -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cdac433295dc4d39b4a5377d147f50fc)](https://www.codacy.com/gh/guibranco/CrispyWaffle/dashboard?utm_source=github.com&utm_medium=referral&utm_content=guibranco/CrispyWaffle&utm_campaign=Badge_Grade) -[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/cdac433295dc4d39b4a5377d147f50fc)](https://www.codacy.com/gh/guibranco/CrispyWaffle/dashboard?utm_source=github.com&utm_medium=referral&utm_content=guibranco/CrispyWaffle&utm_campaign=Badge_Coverage) - -[![codecov](https://codecov.io/gh/guibranco/CrispyWaffle/branch/main/graph/badge.svg)](https://codecov.io/gh/guibranco/CrispyWaffle) -[![CodeFactor](https://www.codefactor.io/repository/github/guibranco/CrispyWaffle/badge)](https://www.codefactor.io/repository/github/guibranco/CrispyWaffle) - -[![Maintainability](https://api.codeclimate.com/v1/badges/fdaf045297f48946696a/maintainability)](https://codeclimate.com/github/guibranco/CrispyWaffle/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/fdaf045297f48946696a/test_coverage)](https://codeclimate.com/github/guibranco/CrispyWaffle/test_coverage) - -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=alert_status)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) -[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) - -[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=sqale_index)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) -[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) - -[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) -[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=security_rating)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) - -[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=bugs)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) -[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) - -[![DeepSource](https://app.deepsource.com/gh/guibranco/CrispyWaffle.svg/?label=active+issues&show_trend=true&token=r3XGa8MQHGZERdIhKB5EZXfL)](https://app.deepsource.com/gh/guibranco/CrispyWaffle/?ref=repository-badge) - ---- - -## .NET support - -As of August 2024, this toolkit is currently published in the following `.NET` versions: - -- .NET Standard 2.0 -- .NET Standard 2.1 -- .NET 6.0 -- .NET 8.0 - -This is an official Microsoft [.NET-supported versions](https://dotnet.microsoft.com/en-us/platform/dotnet-standard) table based on the lowest target version (.NET Standard 2.0): -![Supported version as of Aug/2024](docs/images/supported-versions-2024-08.png) - ---- - -## Installation - -### Github Releases - -[![GitHub last release](https://img.shields.io/github/release-date/guibranco/CrispyWaffle.svg?style=flat)](https://github.com/guibranco/CrispyWaffle) [![Github All Releases](https://img.shields.io/github/downloads/guibranco/CrispyWaffle/total.svg?style=flat)](https://github.com/guibranco/CrispyWaffle) - -Download the latest zip file from the [Release](https://github.com/GuiBranco/CrispyWaffle/releases) page. - -### Nuget package manager - -| Package | Version | Downloads | -| ------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -| **CrispyWaffle** | [![CrispyWaffle NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle/) | [![CrispyWaffle NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle/) | -| **CrispyWaffle.Configuration** | [![CrispyWaffle Configuration NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Configuration.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Configuration/) | [![CrispyWaffle Configuration NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Configuration.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Configuration/) | -| **CrispyWaffle.ElasticSearch** | [![CrispyWaffle ElasticSearch NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.ElasticSearch.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.ElasticSearch/) | [![CrispyWaffle ElasticSearch NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.ElasticSearch.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.ElasticSearch/) | -| **CrispyWaffle.Elmah** | [![CrispyWaffle ELMAH NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Elmah.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Elmah/) | [![CrispyWaffle ELMAH NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Elmah.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Elmah/) | -| **CrispyWaffle.EventLog** | [![CrispyWaffle Event Log NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.EventLog.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.EventLog/) | [![CrispyWaffle Event Log NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.EventLog.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.EventLog/) | -| **CrispyWaffle.Log4Net** | [![CrispyWaffle Log4Net NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Log4Net.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Log4Net/) | [![CrispyWaffle Log4Net NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Log4Net.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Log4Net/) | -| **CrispyWaffle.RabbitMQ** | [![CrispyWaffle.RabbitMQ NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.RabbitMQ.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.RabbitMQ/) | [![CrispyWaffle.RabbitMQ NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.RabbitMQ.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.RabbitMQ/) | -| **CrispyWaffle.Redis** | [![CrispyWaffle Redis NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Redis.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Redis/) | [![CrispyWaffle Redis NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Redis.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Redis/) | -| **CrispyWaffle.Utils** | [![CrispyWaffle Utils NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Utils.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Utils/) | [![CrispyWaffle Utils NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Utils.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Utils/) | - -#### Language packages - -| Package | Version | Downloads | -| --------- | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------: | -| **CrispyWaffle.I18n.PtBr** | [![PT-BR NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.I18n.PtBr.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.I18n.PtBr/) | [![PT-BR NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.I18n.PtBr.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.I18n.PtBr/) | - -More information is available [here](https://guibranco.github.io/CrispyWaffle/installation/). - ---- - -## User guide - -The user guide is available [here](https://guibranco.github.io/CrispyWaffle/user-guide/basic-usage/). - ---- - -## Changelog - -The changelog is available [here](https://guibranco.github.io/CrispyWaffle/changelog/). - ---- - -## Support - -Please [open an issue](https://github.com/guibranco/crispywaffle/issues/new) for support. - ---- - -## Contributing - -Refer to [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to contribute to this project! - -### Contributors - +# YAML Serialization Support + +This project now supports YAML serialization and deserialization using the `YamlSerializer` class. + +## Usage + +```csharp +var serializer = new YamlSerializer(); +var yaml = serializer.Serialize(new { Name = "Test", Value = 123 }); +var obj = serializer.Deserialize(yaml); +# Crispy Waffle + +🧰 🛠️ Crispy Waffle project - a toolkit for .NET projects. + +[![GitHub license](https://img.shields.io/github/license/guibranco/CrispyWaffle)](https://github.com/guibranco/CrispyWaffle) +[![Time tracker](https://wakatime.com/badge/github/guibranco/CrispyWaffle.svg)](https://wakatime.com/badge/github/guibranco/CrispyWaffle) + +![Crispy Waffle logo](https://raw.githubusercontent.com/guibranco/CrispyWaffle/main/logo.png) + +Documentation: [Read the Docs](https://guibranco.github.io/CrispyWaffle/) + +--- + +## Table of content + +- [CI/CD](#cicd): Current project status in the build pipeline (AppVeyor). +- [Code Quality](#code-quality): Metrics from some tools about code quality. +- [.NET support](#.NET-support): Supported .NET version. +- [Installation](#installation): How to install/download this tool. +- [User guide](#user-guide): How to set up, configure and use this tool. +- [Change log](#changelog): Changelog containing the changes done in this project. +- [Support](#support): How to get support. +- [Contributing](#contributing): How to contribute. + +--- + +## CI/CD + +| Build status | Last commit | Tests | Coverage | Code Smells | LoC | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [![Build status](https://ci.appveyor.com/api/projects/status/dr93gad0na076ng3/branch/main?svg=true)](https://ci.appveyor.com/project/guibranco/crispywaffle/branch/main) | [![GitHub last commit](https://img.shields.io/github/last-commit/guibranco/CrispyWaffle/main)](https://github.com/guibranco/CrispyWaffle) | [![AppVeyor tests (branch)](https://img.shields.io/appveyor/tests/guibranco/crispywaffle/main?compact_message)](https://ci.appveyor.com/project/guibranco/crispywaffle/branch/main/tests) | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=coverage)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) | [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=code_smells)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) | [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=ncloc)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) | + +--- + +## Code Quality + +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cdac433295dc4d39b4a5377d147f50fc)](https://www.codacy.com/gh/guibranco/CrispyWaffle/dashboard?utm_source=github.com&utm_medium=referral&utm_content=guibranco/CrispyWaffle&utm_campaign=Badge_Grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/cdac433295dc4d39b4a5377d147f50fc)](https://www.codacy.com/gh/guibranco/CrispyWaffle/dashboard?utm_source=github.com&utm_medium=referral&utm_content=guibranco/CrispyWaffle&utm_campaign=Badge_Coverage) + +[![codecov](https://codecov.io/gh/guibranco/CrispyWaffle/branch/main/graph/badge.svg)](https://codecov.io/gh/guibranco/CrispyWaffle) +[![CodeFactor](https://www.codefactor.io/repository/github/guibranco/CrispyWaffle/badge)](https://www.codefactor.io/repository/github/guibranco/CrispyWaffle) + +[![Maintainability](https://api.codeclimate.com/v1/badges/fdaf045297f48946696a/maintainability)](https://codeclimate.com/github/guibranco/CrispyWaffle/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/fdaf045297f48946696a/test_coverage)](https://codeclimate.com/github/guibranco/CrispyWaffle/test_coverage) + +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=alert_status)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) + +[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=sqale_index)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) +[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) + +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=security_rating)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) + +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=bugs)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) +[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=guibranco_CrispyWaffle&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=guibranco_CrispyWaffle) + +[![DeepSource](https://app.deepsource.com/gh/guibranco/CrispyWaffle.svg/?label=active+issues&show_trend=true&token=r3XGa8MQHGZERdIhKB5EZXfL)](https://app.deepsource.com/gh/guibranco/CrispyWaffle/?ref=repository-badge) + +--- + +## .NET support + +As of August 2024, this toolkit is currently published in the following `.NET` versions: + +- .NET Standard 2.0 +- .NET Standard 2.1 +- .NET 6.0 +- .NET 8.0 + +This is an official Microsoft [.NET-supported versions](https://dotnet.microsoft.com/en-us/platform/dotnet-standard) table based on the lowest target version (.NET Standard 2.0): +![Supported version as of Aug/2024](docs/images/supported-versions-2024-08.png) + +--- + +## Installation + +### Github Releases + +[![GitHub last release](https://img.shields.io/github/release-date/guibranco/CrispyWaffle.svg?style=flat)](https://github.com/guibranco/CrispyWaffle) [![Github All Releases](https://img.shields.io/github/downloads/guibranco/CrispyWaffle/total.svg?style=flat)](https://github.com/guibranco/CrispyWaffle) + +Download the latest zip file from the [Release](https://github.com/GuiBranco/CrispyWaffle/releases) page. + +### Nuget package manager + +| Package | Version | Downloads | +| ------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| **CrispyWaffle** | [![CrispyWaffle NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle/) | [![CrispyWaffle NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle/) | +| **CrispyWaffle.Configuration** | [![CrispyWaffle Configuration NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Configuration.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Configuration/) | [![CrispyWaffle Configuration NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Configuration.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Configuration/) | +| **CrispyWaffle.ElasticSearch** | [![CrispyWaffle ElasticSearch NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.ElasticSearch.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.ElasticSearch/) | [![CrispyWaffle ElasticSearch NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.ElasticSearch.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.ElasticSearch/) | +| **CrispyWaffle.Elmah** | [![CrispyWaffle ELMAH NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Elmah.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Elmah/) | [![CrispyWaffle ELMAH NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Elmah.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Elmah/) | +| **CrispyWaffle.EventLog** | [![CrispyWaffle Event Log NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.EventLog.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.EventLog/) | [![CrispyWaffle Event Log NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.EventLog.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.EventLog/) | +| **CrispyWaffle.Log4Net** | [![CrispyWaffle Log4Net NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Log4Net.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Log4Net/) | [![CrispyWaffle Log4Net NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Log4Net.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Log4Net/) | +| **CrispyWaffle.RabbitMQ** | [![CrispyWaffle.RabbitMQ NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.RabbitMQ.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.RabbitMQ/) | [![CrispyWaffle.RabbitMQ NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.RabbitMQ.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.RabbitMQ/) | +| **CrispyWaffle.Redis** | [![CrispyWaffle Redis NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Redis.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Redis/) | [![CrispyWaffle Redis NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Redis.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Redis/) | +| **CrispyWaffle.Utils** | [![CrispyWaffle Utils NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.Utils.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Utils/) | [![CrispyWaffle Utils NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.Utils.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.Utils/) | + +#### Language packages + +| Package | Version | Downloads | +| --------- | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------: | +| **CrispyWaffle.I18n.PtBr** | [![PT-BR NuGet Version](https://img.shields.io/nuget/v/CrispyWaffle.I18n.PtBr.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.I18n.PtBr/) | [![PT-BR NuGet Downloads](https://img.shields.io/nuget/dt/CrispyWaffle.I18n.PtBr.svg?style=flat)](https://www.nuget.org/packages/CrispyWaffle.I18n.PtBr/) | + +More information is available [here](https://guibranco.github.io/CrispyWaffle/installation/). + +--- + +## User guide + +The user guide is available [here](https://guibranco.github.io/CrispyWaffle/user-guide/basic-usage/). + +--- + +## Changelog + +The changelog is available [here](https://guibranco.github.io/CrispyWaffle/changelog/). + +--- + +## Support + +Please [open an issue](https://github.com/guibranco/crispywaffle/issues/new) for support. + +--- + +## Contributing + +Refer to [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to contribute to this project! + +### Contributors + @@ -215,10 +225,10 @@ Refer to [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to contribute to this p
- - -### Bots - + + +### Bots + @@ -284,5 +294,5 @@ Refer to [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to contribute to this p
- - + + diff --git a/Src/CrispyWaffle/Serialization/SerializationInterfaces.cs b/Src/CrispyWaffle/Serialization/SerializationInterfaces.cs new file mode 100644 index 00000000..577da604 --- /dev/null +++ b/Src/CrispyWaffle/Serialization/SerializationInterfaces.cs @@ -0,0 +1,12 @@ +namespace CrispyWaffle.Serialization +{ + public interface ISerializer + { + string Serialize(T obj); + } + + public interface IDeserializer + { + T Deserialize(string yaml); + } +} diff --git a/Src/CrispyWaffle/Serialization/YamlSerializer.cs b/Src/CrispyWaffle/Serialization/YamlSerializer.cs new file mode 100644 index 00000000..e3a1bf90 --- /dev/null +++ b/Src/CrispyWaffle/Serialization/YamlSerializer.cs @@ -0,0 +1,21 @@ +using System; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.NamingConventions; + +namespace CrispyWaffle.Serialization +{ + public class YamlSerializer + { + private readonly ISerializer _serializer; + private readonly IDeserializer _deserializer; + + public YamlSerializer() + { + _serializer = new SerializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build(); + _deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build(); + } + + public string Serialize(T obj) => _serializer.Serialize(obj); + public T Deserialize(string yaml) => _deserializer.Deserialize(yaml); + } +} \ No newline at end of file diff --git a/Tests/CrispyWaffle.Tests/Serialization/YamlSerializerTests.cs b/Tests/CrispyWaffle.Tests/Serialization/YamlSerializerTests.cs new file mode 100644 index 00000000..a782187e --- /dev/null +++ b/Tests/CrispyWaffle.Tests/Serialization/YamlSerializerTests.cs @@ -0,0 +1,34 @@ +using System; +using Xunit; +using CrispyWaffle.Serialization; + +namespace CrispyWaffle.Tests.Serialization +{ + public class YamlSerializerTests + { + private readonly YamlSerializer _serializer; + + public YamlSerializerTests() + { + _serializer = new YamlSerializer(); + } + + [Fact] + public void Serialize_ShouldReturnYamlString() + { + var obj = new { Name = "Test", Value = 123 }; + var yaml = _serializer.Serialize(obj); + Assert.Contains("name: Test", yaml); + Assert.Contains("value: 123", yaml); + } + + [Fact] + public void Deserialize_ShouldReturnObject() + { + var yaml = "name: Test\nvalue: 123"; + var obj = _serializer.Deserialize(yaml); + Assert.Equal("Test", (string)obj.Name); + Assert.Equal(123, (int)obj.Value); + } + } +} diff --git a/docs/changelog.md b/docs/changelog.md index 2883267b..d4c14e23 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,113 +1,119 @@ -# Changelog - -## Version 8.2 [2024-09-11] - -- Implement CouchDB cache - [issue #499](https://github.com/guibranco/CrispyWaffle/issues/499) and [pull request #544](https://github.com/guibranco/CrispyWaffle/pull/544) by [@Mohammad-Haris](https://github.com/Mohammad-Haris) - -## Version 8.1 [2024-08-08] - -- Implement rolling text file log adapter - [issue #37](https://github.com/guibranco/CrispyWaffle/issues/37) and [pull request #479](https://github.com/guibranco/CrispyWaffle/pull/479) by [@Mohammad-Haris](https://github.com/Mohammad-Haris) - -## Version 8.0 [2024-07-28] - -- Replace NEST and ElasticSearch.Net with Elastic.Clients.Elasticsearch - [issue #444](https://github.com/guibranco/CrispyWaffle/issues/444) and [pull request #470](https://github.com/guibranco/CrispyWaffle/pull/470) by [@Mohammad-Haris](https://github.com/Mohammad-Haris) -- Remove binary serializer - [issue #462](https://github.com/guibranco/CrispyWaffle/issues/462) and [pull request #463](https://github.com/guibranco/CrispyWaffle/pull/463) by [@Mohammad-Haris](https://github.com/Mohammad-Haris) - -## Version 7.0 [2024-07-21] - -- Rename LifeStyle to Lifetime - [pull request #445](https://github.com/guibranco/CrispyWaffle/pull/445) -- Fix build warnings - -## Version 6.0 [2024-05-20] - -- Create i18n package - PT-BR - [issue #315](https://github.com/guibranco/CrispyWaffle/issues/315) - -## Version 5.0 [2024-01-31] - -- Replaced MD5CryptoServiceProvider to MD5.Create - [issue #155](https://github.com/guibranco/CrispyWaffle/issues/155) by [@tiagoschaffer](https://github.com/tiagoschaffer) -- Add System.Text.Json serialization - [issue #192](https://github.com/guibranco/CrispyWaffle/issues/192) by [@Looseling](https://github.com/Looseling) - -## Version 4.3 [2023-10-28] - -- Remove retry rules from `FtpClient` - [issue #211](https://github.com/guibranco/CrispyWaffle/issues/211) by [@Yousef-Majidi](https://github.com/Yousef-Majidi) -- Create `BaseSerializerAdapter` - [issue #185](https://github.com/guibranco/CrispyWaffle/issues/185) -- Adjust namespaces -- Fix some code smells - -## Version 4.2 [2023-07-24] - -- Fix SonarCloud reports - [issue #182](https://github.com/guibranco/CrispyWaffle/issues/182) by [@viktoriussuwandi](https://github.com/viktoriussuwandi) -- Fix security in GitHub Actions and AppVeyor pipeline -- Add CSharpier (Linter) -- Add DeepSource scanner - -## Version 4.1 [2023-03-22] - -- Add Utils project - [issue #150](https://github.com/guibranco/CrispyWaffle/issues/150) - -## Version 4.0 [2023-03-22] - -- Add NuGet README.md - [issue #139](https://github.com/guibranco/CrispyWaffle/issues/139) - -## Version 3.1 [2022-09-10] - -- Add CrispyWaffle.ElasticSearch project & package - [issue #119](https://github.com/guibranco/CrispyWaffle/issues/119). - -## Version 3.0 [2022-09-09] - -- Upgrade dependencies and increase unit test coverage. - -## Version 2.5 [2020-09-07] - -- Add CrispyWaffle.RabbitMQ project & package - [issue #92](https://github.com/guibranco/CrispyWaffle/issues/92). - -## Version 2.4 [2020-09-06] - -- Add CrispyWaffle.Redis project & package. -- Add documentation for caching. - -## Version 2.3 [2020-09-06] - -- Add FailoverExceptionHandler class - [issue #73](https://github.com/guibranco/CrispyWaffle/issues/73). -- Add Environment Helper class - [issue #75](https://github.com/guibranco/CrispyWaffle/issues/75). - -## Version 2.2 [2020-09-05] - -- Add a scheduler feature. -- Add documentation using MkDocs. - -## Version 2.1 [2020-09-04] - -- Add the Configuration project and package. -- Add Mustache template engine (inspired by Mustache/Handlebars). -- Add Resource template repository. -- Add Elmah & Log4Net projects (logging). -- Basic usage examples. - -## Version 2.0 [2020-08-03] - -- Removed some application-specific patterns from the *StringExtensions* class - -## Version 1.3 [2020-07-24] - -- Add EvenLogProvider and EventLogAdapter. -- Add log Trace methods that support exceptions. -- Add Fatal log level. - -## Version 1.2 [2020-03-28] - -- Add some unit tests. -- Update appveyor.yml with build enhancements and test coverages. -- Update readme template. - -## Version 1.1 [2019-09-27] - -- Add Math Extensions (CrispyWaffle.Extensions.MathExtensions namespace). -- Add Personal Data Validations (CrispyWaffle.Validations.PersonalDataValidations). -- Rename method *FormatDocument* to *FormatBrazilianDocument* (CrispyWaffle.Extensions.ConversionExtensions). -- Rename method *ParsePhoneNumber* to *arseBrazilianPhoneNumber* (CrispyWaffle.Extensions.ConversionExtensions). -- Removed *CleanListItems* (CrispyWaffle.Extensions.ConversionExtensions). -- Rename method *TryParsePhoneNumber* to *TryParseBrazilianPhoneNumber* (CrispyWaffle.Extensions.ConversionExtensions). -- Removed *CleanListItems* and *ToListString* (CrispyWaffle.Extensions.ConversionExtensions) **(Specific to application patterns)**. - ---- +## Version 1.1.0 [Unreleased] + +- Added support for YAML serialization and deserialization. +- Introduced `YamlSerializer` class in `CrispyWaffle.Serialization`. +- Updated documentation with usage examples for YAML serialization. + +# Changelog + +## Version 8.2 [2024-09-11] + +- Implement CouchDB cache - [issue #499](https://github.com/guibranco/CrispyWaffle/issues/499) and [pull request #544](https://github.com/guibranco/CrispyWaffle/pull/544) by [@Mohammad-Haris](https://github.com/Mohammad-Haris) + +## Version 8.1 [2024-08-08] + +- Implement rolling text file log adapter - [issue #37](https://github.com/guibranco/CrispyWaffle/issues/37) and [pull request #479](https://github.com/guibranco/CrispyWaffle/pull/479) by [@Mohammad-Haris](https://github.com/Mohammad-Haris) + +## Version 8.0 [2024-07-28] + +- Replace NEST and ElasticSearch.Net with Elastic.Clients.Elasticsearch - [issue #444](https://github.com/guibranco/CrispyWaffle/issues/444) and [pull request #470](https://github.com/guibranco/CrispyWaffle/pull/470) by [@Mohammad-Haris](https://github.com/Mohammad-Haris) +- Remove binary serializer - [issue #462](https://github.com/guibranco/CrispyWaffle/issues/462) and [pull request #463](https://github.com/guibranco/CrispyWaffle/pull/463) by [@Mohammad-Haris](https://github.com/Mohammad-Haris) + +## Version 7.0 [2024-07-21] + +- Rename LifeStyle to Lifetime - [pull request #445](https://github.com/guibranco/CrispyWaffle/pull/445) +- Fix build warnings + +## Version 6.0 [2024-05-20] + +- Create i18n package - PT-BR - [issue #315](https://github.com/guibranco/CrispyWaffle/issues/315) + +## Version 5.0 [2024-01-31] + +- Replaced MD5CryptoServiceProvider to MD5.Create - [issue #155](https://github.com/guibranco/CrispyWaffle/issues/155) by [@tiagoschaffer](https://github.com/tiagoschaffer) +- Add System.Text.Json serialization - [issue #192](https://github.com/guibranco/CrispyWaffle/issues/192) by [@Looseling](https://github.com/Looseling) + +## Version 4.3 [2023-10-28] + +- Remove retry rules from `FtpClient` - [issue #211](https://github.com/guibranco/CrispyWaffle/issues/211) by [@Yousef-Majidi](https://github.com/Yousef-Majidi) +- Create `BaseSerializerAdapter` - [issue #185](https://github.com/guibranco/CrispyWaffle/issues/185) +- Adjust namespaces +- Fix some code smells + +## Version 4.2 [2023-07-24] + +- Fix SonarCloud reports - [issue #182](https://github.com/guibranco/CrispyWaffle/issues/182) by [@viktoriussuwandi](https://github.com/viktoriussuwandi) +- Fix security in GitHub Actions and AppVeyor pipeline +- Add CSharpier (Linter) +- Add DeepSource scanner + +## Version 4.1 [2023-03-22] + +- Add Utils project - [issue #150](https://github.com/guibranco/CrispyWaffle/issues/150) + +## Version 4.0 [2023-03-22] + +- Add NuGet README.md - [issue #139](https://github.com/guibranco/CrispyWaffle/issues/139) + +## Version 3.1 [2022-09-10] + +- Add CrispyWaffle.ElasticSearch project & package - [issue #119](https://github.com/guibranco/CrispyWaffle/issues/119). + +## Version 3.0 [2022-09-09] + +- Upgrade dependencies and increase unit test coverage. + +## Version 2.5 [2020-09-07] + +- Add CrispyWaffle.RabbitMQ project & package - [issue #92](https://github.com/guibranco/CrispyWaffle/issues/92). + +## Version 2.4 [2020-09-06] + +- Add CrispyWaffle.Redis project & package. +- Add documentation for caching. + +## Version 2.3 [2020-09-06] + +- Add FailoverExceptionHandler class - [issue #73](https://github.com/guibranco/CrispyWaffle/issues/73). +- Add Environment Helper class - [issue #75](https://github.com/guibranco/CrispyWaffle/issues/75). + +## Version 2.2 [2020-09-05] + +- Add a scheduler feature. +- Add documentation using MkDocs. + +## Version 2.1 [2020-09-04] + +- Add the Configuration project and package. +- Add Mustache template engine (inspired by Mustache/Handlebars). +- Add Resource template repository. +- Add Elmah & Log4Net projects (logging). +- Basic usage examples. + +## Version 2.0 [2020-08-03] + +- Removed some application-specific patterns from the *StringExtensions* class + +## Version 1.3 [2020-07-24] + +- Add EvenLogProvider and EventLogAdapter. +- Add log Trace methods that support exceptions. +- Add Fatal log level. + +## Version 1.2 [2020-03-28] + +- Add some unit tests. +- Update appveyor.yml with build enhancements and test coverages. +- Update readme template. + +## Version 1.1 [2019-09-27] + +- Add Math Extensions (CrispyWaffle.Extensions.MathExtensions namespace). +- Add Personal Data Validations (CrispyWaffle.Validations.PersonalDataValidations). +- Rename method *FormatDocument* to *FormatBrazilianDocument* (CrispyWaffle.Extensions.ConversionExtensions). +- Rename method *ParsePhoneNumber* to *arseBrazilianPhoneNumber* (CrispyWaffle.Extensions.ConversionExtensions). +- Removed *CleanListItems* (CrispyWaffle.Extensions.ConversionExtensions). +- Rename method *TryParsePhoneNumber* to *TryParseBrazilianPhoneNumber* (CrispyWaffle.Extensions.ConversionExtensions). +- Removed *CleanListItems* and *ToListString* (CrispyWaffle.Extensions.ConversionExtensions) **(Specific to application patterns)**. + +--- diff --git a/docs/serialization.md b/docs/serialization.md new file mode 100644 index 00000000..afb5f0a3 --- /dev/null +++ b/docs/serialization.md @@ -0,0 +1,18 @@ +# YAML Serialization + +The `YamlSerializer` class provides methods for serializing objects to YAML strings and deserializing YAML content back into objects. + +## Features + +- **Serialize**: Convert objects to YAML format. +- **Deserialize**: Convert YAML content back into objects. + +## Example + +```csharp +var serializer = new YamlSerializer(); +var yaml = serializer.Serialize(new { Name = "Test", Value = 123 }); +var obj = serializer.Deserialize(yaml); +``` + +This feature is built using the YamlDotNet library, ensuring robust and efficient YAML processing.