Datasilk.Core.Mvc
1.0.8.2
dotnet add package Datasilk.Core.Mvc --version 1.0.8.2
NuGet\Install-Package Datasilk.Core.Mvc -Version 1.0.8.2
<PackageReference Include="Datasilk.Core.Mvc" Version="1.0.8.2" />
paket add Datasilk.Core.Mvc --version 1.0.8.2
#r "nuget: Datasilk.Core.Mvc, 1.0.8.2"
// Install Datasilk.Core.Mvc as a Cake Addin #addin nuget:?package=Datasilk.Core.Mvc&version=1.0.8.2 // Install Datasilk.Core.Mvc as a Cake Tool #tool nuget:?package=Datasilk.Core.Mvc&version=1.0.8.2
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
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Datasilk.Core.Mvc:
Package | Downloads |
---|---|
Saber.Core
Core MVC classes & interfaces used in the Saber website builder. |
|
Kandu.Core
The core interfaces, classes, and middleware for Kandu, used by plugin developers. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.8.2 | 612 | 3/26/2023 |
1.0.8.1 | 206 | 3/20/2023 |
1.0.8 | 806 | 11/18/2022 |
1.0.7.9 | 409 | 7/21/2022 |
1.0.7.8 | 443 | 3/4/2022 |
1.0.7.7 | 414 | 2/23/2022 |
1.0.7.6 | 444 | 11/28/2021 |
1.0.7.5 | 465 | 11/3/2021 |
1.0.7.4 | 354 | 11/3/2021 |
1.0.7.3 | 274 | 11/2/2021 |
1.0.7.2 | 277 | 11/2/2021 |
1.0.7.1 | 339 | 10/17/2021 |
1.0.7 | 1,115 | 3/14/2021 |
1.0.6.5 | 386 | 12/10/2020 |
1.0.6.4 | 385 | 12/10/2020 |
1.0.6.3 | 483 | 11/24/2020 |
1.0.6.2 | 592 | 11/14/2020 |
1.0.6 | 507 | 11/12/2020 |
1.0.5.2 | 471 | 11/12/2020 |
1.0.5 | 602 | 11/10/2020 |
1.0.4.2 | 1,218 | 11/6/2020 |
1.0.4.1 | 404 | 11/6/2020 |
1.0.4 | 399 | 11/6/2020 |
1.0.3 | 424 | 9/29/2020 |
1.0.2 | 506 | 11/9/2019 |
1.0.1 | 475 | 11/9/2019 |
1.0.0 | 484 | 11/9/2019 |
Fixed caching issue with View.Partial, fixed issue with partial includes mustache variable parameters disappearing, cleaned up View class by removing unused classes, methods, & vars, and optimized the Render function.