method renames
This commit is contained in:
parent
aa3accb412
commit
e5cb210df2
@ -11,6 +11,6 @@ namespace BinaryDad.Notes.Controllers
|
||||
public ApiController(INoteService noteService) => this.noteService = noteService;
|
||||
|
||||
[Route("note/{noteName}")]
|
||||
public string Note(string noteName) => noteService.GetText(noteName);
|
||||
public string Note(string noteName) => noteService.GetNote(noteName);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public class NoteController : Controller
|
||||
var model = new ContentModel
|
||||
{
|
||||
CurrentNote = noteName,
|
||||
Text = noteService.GetText(noteName),
|
||||
Text = noteService.GetNote(noteName),
|
||||
NoteNames = noteService.GetNoteNames()
|
||||
};
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace BinaryDad.Notes
|
||||
|
||||
public async Task SaveNote(string content, string noteName)
|
||||
{
|
||||
noteService.SaveText(content, noteName);
|
||||
noteService.SaveNote(content, noteName);
|
||||
|
||||
// find all other connections except for the current one
|
||||
var clientConnections = NoteContext.ClientNotes
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
public string GetText(string noteName)
|
||||
public string GetNote(string noteName)
|
||||
{
|
||||
CheckFile(noteName);
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void SaveText(string content, string noteName)
|
||||
public void SaveNote(string content, string noteName)
|
||||
{
|
||||
File.WriteAllText(GetFilePath(noteName), content);
|
||||
}
|
||||
@ -51,7 +51,7 @@
|
||||
{
|
||||
Directory.CreateDirectory(folderPath);
|
||||
|
||||
SaveText("Hi! Feel free to start typing. Everything will be saved soon after you are done typing.", noteName);
|
||||
SaveNote("Hi! Feel free to start typing. Everything will be saved soon after you are done typing.", noteName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
public interface INoteService
|
||||
{
|
||||
ICollection<string> GetNoteNames();
|
||||
string GetText(string noteName);
|
||||
void SaveText(string content, string noteName);
|
||||
string GetNote(string noteName);
|
||||
void SaveNote(string content, string noteName);
|
||||
void DeleteNote(string noteName);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user