Datasilk.Core.Mvc
1.0.5
An ultra-lightweight MVC framework for the web that handles page requests and RESTful web API calls.
See the version list below for details.
Install-Package Datasilk.Core.Mvc -Version 1.0.5
dotnet add package Datasilk.Core.Mvc --version 1.0.5
<PackageReference Include="Datasilk.Core.Mvc" Version="1.0.5" />
paket add Datasilk.Core.Mvc --version 1.0.5
#r "nuget: Datasilk.Core.Mvc, 1.0.5"
Datasilk Core MVC
An MVC Framework for ASP.NET Core
Datasilk Core is an ultra-fast, light-weight alternative to ASP.NET Core MVC, it supports Views using HTML with mustache variables, hierarchical Controller rendering, and RESTful web services.
Startup.cs
Make sure to include the middleware within Startup.cs
.
app.UseDatasilkMvc(new MvcOptions()
{
IgnoreRequestBodySize = true,
WriteDebugInfoToConsole = true,
Routes = new Routes()
});
Page Requests
All page request URLs are mapped to controllers that inherit the Datasilk.Core.Web.IController
interface. For example, the URL http://localhost:7770/products
would map to the class MyProject.Controllers.Products
.
/Views/Home/home.html
<div class="hero">
<h1>{{title}}</h1>
<h3>{{description}}</h3>
</div>
/Controllers/Home.cs
namespace MyProject.Controllers
{
public class Home: Datasilk.Core.Web.Controller
{
public override string Render(string body = "")
{
//render page
var view = new View("/Views/Home/home.html");
view["title"] = "Welcome";
view["description"] = "I like to write software";
AddScript("/js/views/home/home.js");
return view.Render();
}
}
}
Web Services
The Datasilk Core MVC framework comes with the ability to call RESTful web APIs. All web API calls are executed from Datasilk.Core.Web.IService
interfaces.
Example
namespace MyProject.Services
{
public class User: Datasilk.Core.Web.Service
{
[POST]
public string Authenticate(string email, string password)
{
//authenticate user
if(Authenticated(email, password))
{
return Success();
}
else
{
return AccessDenied("Incorrect email and/or password");
}
}
}
}
Read more Documentation on Github
Datasilk Core MVC
An MVC Framework for ASP.NET Core
Datasilk Core is an ultra-fast, light-weight alternative to ASP.NET Core MVC, it supports Views using HTML with mustache variables, hierarchical Controller rendering, and RESTful web services.
Startup.cs
Make sure to include the middleware within Startup.cs
.
app.UseDatasilkMvc(new MvcOptions()
{
IgnoreRequestBodySize = true,
WriteDebugInfoToConsole = true,
Routes = new Routes()
});
Page Requests
All page request URLs are mapped to controllers that inherit the Datasilk.Core.Web.IController
interface. For example, the URL http://localhost:7770/products
would map to the class MyProject.Controllers.Products
.
/Views/Home/home.html
<div class="hero">
<h1>{{title}}</h1>
<h3>{{description}}</h3>
</div>
/Controllers/Home.cs
namespace MyProject.Controllers
{
public class Home: Datasilk.Core.Web.Controller
{
public override string Render(string body = "")
{
//render page
var view = new View("/Views/Home/home.html");
view["title"] = "Welcome";
view["description"] = "I like to write software";
AddScript("/js/views/home/home.js");
return view.Render();
}
}
}
Web Services
The Datasilk Core MVC framework comes with the ability to call RESTful web APIs. All web API calls are executed from Datasilk.Core.Web.IService
interfaces.
Example
namespace MyProject.Services
{
public class User: Datasilk.Core.Web.Service
{
[POST]
public string Authenticate(string email, string password)
{
//authenticate user
if(Authenticated(email, password))
{
return Success();
}
else
{
return AccessDenied("Incorrect email and/or password");
}
}
}
}
Read more Documentation on Github
Release Notes
Added path pointer system for View partials so developers can use pointer paths instead of relative paths in their HTML mustache code.
Dependencies
-
.NETCoreApp 3.1
- No dependencies.
Used By
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Datasilk.Core.Mvc:
Package | Downloads |
---|---|
Saber.Core
Core MVC interfaces used in the Saber MVC website builder.
|
GitHub repositories
This package is not used by any popular GitHub repositories.
Version History
Version | Downloads | Last updated |
---|---|---|
1.0.6.5 | 67 | 12/10/2020 |
1.0.6.4 | 92 | 12/10/2020 |
1.0.6.3 | 81 | 11/24/2020 |
1.0.6.2 | 185 | 11/14/2020 |
1.0.6 | 102 | 11/12/2020 |
1.0.5.2 | 65 | 11/12/2020 |
1.0.5 | 94 | 11/10/2020 |
1.0.4.2 | 190 | 11/6/2020 |
1.0.4.1 | 87 | 11/6/2020 |
1.0.4 | 85 | 11/6/2020 |
1.0.3 | 122 | 9/29/2020 |
1.0.2 | 197 | 11/9/2019 |
1.0.1 | 167 | 11/9/2019 |
1.0.0 | 172 | 11/9/2019 |