use expression bodies
This commit is contained in:
parent
70b0d0cba3
commit
2e4903481c
@ -7,10 +7,7 @@ namespace BinaryDad.Notes.Controllers
|
|||||||
{
|
{
|
||||||
private readonly INoteService noteService;
|
private readonly INoteService noteService;
|
||||||
|
|
||||||
public ApiController(INoteService noteService)
|
public ApiController(INoteService noteService) => this.noteService = noteService;
|
||||||
{
|
|
||||||
this.noteService = noteService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Note() => noteService.Get();
|
public string Note() => noteService.Get();
|
||||||
}
|
}
|
||||||
|
@ -9,10 +9,7 @@ public class NoteController : Controller
|
|||||||
{
|
{
|
||||||
private readonly INoteService noteService;
|
private readonly INoteService noteService;
|
||||||
|
|
||||||
public NoteController(INoteService noteService)
|
public NoteController(INoteService noteService) => this.noteService = noteService;
|
||||||
{
|
|
||||||
this.noteService = noteService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IActionResult Index()
|
public IActionResult Index()
|
||||||
{
|
{
|
||||||
|
@ -15,14 +15,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Get()
|
public string Get() => File.ReadAllText(filePath);
|
||||||
{
|
|
||||||
return File.ReadAllText(filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Save(string content)
|
public void Save(string content) => File.WriteAllText(filePath, content);
|
||||||
{
|
|
||||||
File.WriteAllText(filePath, content);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user