-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from PandaTechAM/development
Naming convention has been added
- Loading branch information
Showing
10 changed files
with
195 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dtos/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dtos/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=gridify/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
src/ResponseCrafter/Extensions/NamingConventionExtensions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Humanizer; | ||
using ResponseCrafter.Enums; | ||
using ResponseCrafter.Options; | ||
|
||
namespace ResponseCrafter.Extensions; | ||
|
||
public static class StringExtensions | ||
{ | ||
public static string ConvertCase(this string message, NamingConvention namingConvention) | ||
{ | ||
return namingConvention switch | ||
{ | ||
NamingConvention.Default => message, | ||
NamingConvention.ToSnakeCase => message.Underscore(), | ||
NamingConvention.ToPascalCase => message.Underscore().Pascalize(), | ||
NamingConvention.ToCamelCase => message.Underscore().Camelize(), | ||
NamingConvention.ToKebabCase => message.Underscore().Kebaberize(), | ||
NamingConvention.ToTitleCase => message.Underscore().Titleize(), | ||
NamingConvention.ToHumanCase => message.Underscore().Humanize(), | ||
_ => message | ||
}; | ||
} | ||
|
||
internal static string ConvertCase(this string message, NamingConventionOptions option) | ||
{ | ||
return message.ConvertCase(option.NamingConvention); | ||
} | ||
} |
27 changes: 9 additions & 18 deletions
27
src/ResponseCrafter/Extensions/WebApplicationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using ResponseCrafter.Enums; | ||
|
||
namespace ResponseCrafter.Options; | ||
|
||
public class NamingConventionOptions | ||
{ | ||
public NamingConvention NamingConvention { get; set; } | ||
} |
Oops, something went wrong.