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.
1
using
System.Runtime.CompilerServices;
2
using
SimpleRest.Api
;
3
4
namespace
SimpleRest.Views
;
5
public
class
SimpleRestHomeView
:
ISimpleRestView
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
}
SimpleRest.Views.SimpleRestHomeView
Definition
SimpleRestHomeView.cs:6
SimpleRest.Views.SimpleRestHomeView.GetRelativeFilePath
string GetRelativeFilePath(string pathFromCurrentFile, [CallerFilePath] string sourceFilePath="")
Definition
SimpleRestHomeView.cs:18
SimpleRest.Views.SimpleRestHomeView.GetView
string GetView()
Definition
SimpleRestHomeView.cs:12
SimpleRest.Views.SimpleRestHomeView.GetBytes
byte[] GetBytes()
Definition
SimpleRestHomeView.cs:7
SimpleRest.Views.ISimpleRestView
Definition
ISimpleRestView.cs:3
SimpleRest.Api
Definition
Enums.cs:1
SimpleRest.Views
Definition
ResourceNotFoundView.cs:3
Src
Default types
Views
SimpleRestHomeView.cs
Generated by
1.12.0