using BinaryDad.Notes.Services; using Microsoft.AspNetCore.Mvc; namespace BinaryDad.Notes.Controllers; [ApiController] [Route("[controller]")] public class ApiController : ControllerBase { private readonly INoteService noteService; public ApiController(INoteService noteService) { this.noteService = noteService; } [HttpPost] [Route("save")] public async Task Save() { var content = string.Empty; using (var reader = new StreamReader(Request.Body)) { content = await reader.ReadToEndAsync(); } noteService.Save(content); return true; } }