diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ce7aa17 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) .NET Foundation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE \ No newline at end of file diff --git a/README.md b/README.md index 0e1194b..8fd73fa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -# Supernova.Enum.Generators -# C# Better Enums Source Generator (Very Fast) +[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/EngRajabi/Enum.Source.Generator/master/LICENSE) +[![Nuget](https://img.shields.io/nuget/dt/Supernova.Enum.Generators?label=Nuget.org%20Downloads&style=flat-square&color=blue)](https://www.nuget.org/packages/Supernova.Enum.Generators) + +# Supernova.Enum.Generators +# The best Source Generator for working with enums in C# A C# source generator to create an enumeration class from an enum type. With this package, you can work on enums very, very fast without using reflection. @@ -30,7 +33,8 @@ public enum UserTypeTest } ``` -This will generate a class called `MyEnumExtensions` (by default), which contains a number of helper methods. For example: +This will generate a class called `EnumNameEnumExtensions` (`UserTypeTest` + `EnumExtensions`), which contains a number of helper methods. +For example: ```csharp public static class UserTypeTestEnumExtensions @@ -78,6 +82,8 @@ This will generate a class called `MyEnumExtensions` (by default), which contain } ``` +You do not see this file inside the project. But you can use it. + Usage ```csharp var stringEnum = UserType.Men.StringToFast(); //Men; @@ -87,6 +93,8 @@ var isDefined = UserTypeTestEnumExtensions.IsDefinedFast(UserType.Men); //true; var displayEnum = UserType.Men.ToDisplayFast(); //مرد ``` +If you had trouble using UserTypeTestEnumExtensions and the IDE did not recognize it. This is an IDE problem and you need to restart the IDE once. + Benchmark ![Benchmark](https://raw.githubusercontent.com/EngRajabi/Enum.Source.Generator/master/Supernova.Enum.Generators.png?v=1)