Backend (.NET 10): - EventFlow CQRS/Event Sourcing with PostgreSQL - GraphQL.NET API with mutations and queries - Custom ReadModelSqlGenerator for snake_case PostgreSQL columns - Hangfire for background job processing - Integration tests with isolated test databases Frontend (React/Vite): - Initial project structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
31 lines
No EOL
743 B
C#
31 lines
No EOL
743 B
C#
using System.Reflection;
|
|
|
|
namespace Books.Api.EventFlow.Customs;
|
|
|
|
public static class Casing
|
|
{
|
|
public static string ToSnakeCase(this string input)
|
|
{
|
|
if (string.IsNullOrEmpty(input))
|
|
return input;
|
|
|
|
var stringBuilder = new System.Text.StringBuilder();
|
|
for (var i = 0; i < input.Length; i++)
|
|
{
|
|
var c = input[i];
|
|
if (char.IsUpper(c))
|
|
{
|
|
if (i > 0)
|
|
{
|
|
stringBuilder.Append('_');
|
|
}
|
|
stringBuilder.Append(char.ToLower(c));
|
|
}
|
|
else
|
|
{
|
|
stringBuilder.Append(c);
|
|
}
|
|
}
|
|
return stringBuilder.ToString();
|
|
}
|
|
} |