SimpleREST.NET 0.1
A simple and minimal api framework for .net base on Express.js
Loading...
Searching...
No Matches
SimpleRestHomeView.cs
Go to the documentation of this file.
1using System.Runtime.CompilerServices;
3
4namespace SimpleRest.Views;
6{
7 public byte[] GetBytes()
8 {
9 throw new NotImplementedException();
10 }
11
12 public string GetView()
13 {
14 string fullPath = GetRelativeFilePath("../../Templates/home.html");
15 StreamReader reader = File.OpenText(fullPath);
16 return reader.ReadToEnd();
17 }
18 public string GetRelativeFilePath(string pathFromCurrentFile, [CallerFilePath] string sourceFilePath = "")
19 {
20 string sourceDirectory = Path.GetDirectoryName(sourceFilePath);
21 return Path.Combine(sourceDirectory, pathFromCurrentFile);
22 }
23}
string GetRelativeFilePath(string pathFromCurrentFile, [CallerFilePath] string sourceFilePath="")