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