Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with min
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
943 B

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Shared;
namespace TitlecaseService.Controllers
{
[ApiController]
[Route("[controller]")]
public class TitlecaseController : ControllerBase
{
private readonly ILogger<TitlecaseController> _logger;
public TitlecaseController(ILogger<TitlecaseController> logger)
{
_logger = logger;
}
[HttpGet]
public ActionResult<ConvertedResult> Get(string sentence)
{
_logger.LogInformation($"{GetType().Name} triggered with sentence={sentence}");
return new ConvertedResult()
{
Original = sentence,
Sentence = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(sentence)
};
}
}
}