- Notifications
You must be signed in to change notification settings - Fork9
Moved tohttps://github.com/SimplifyNet. Simplify.Web is a lightweight and fast server-side .NET web-framework based on MVC and OWIN for building HTTP based web-applications, RESTful APIs etc.
License
i4004/Simplify.Web
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project is moved tohttps://github.com/SimplifyNet/Simplify.Web
Simplify.Web is a lightweight and fast server-side .NET web-framework based on MVC and OWIN patterns for building HTTP based web-applications, RESTful APIs etc.
It can be used as:
- An API backend framework
- As a mix of API backend + some SPA front end like Angular
- As an old way backend generated web-site
It can be hosted:
- The same way as an ApsNetCore MVC application (On IIS, or as a console application)
- Inside a windows service
This project is a continuator ofAcspNet web-framework
| Latest version | |
|---|---|
| Dependencies |
| Branch | Status |
|---|---|
| master | |
| develop |
- Comes as Microsoft.AspNetCore OWIN middleware
- Can be used as an API backend only with front-end frameworks
- Based on MVC and MVVM patterns
- Lightweight & Fast
- Uses switchable IOC container for itself and controllers, views constructor injection (Simplify.DI)
- Support async controllers
- Supports controllers which can be run on any request
- Localization-friendly (supports templates, strings and data files localization by default)
- Uses fast templates engine (Simplify.Templates)
- Mocking-friendly
- Mono-friendly
There is a templates package available at nuget.org for Simplify.Web. It contains a couple of templates which can be a good starting point for your application.
Installing a templates package:
dotnet new -i Simplify.Web.Templates| Template | Short Name |
|---|---|
| Angular template | sweb.angular |
| Api template | sweb.api |
| Minimal template | sweb.minimal |
| Windows service hosted api template | sweb.api.windowsservice |
Use the short name to create a project based on selected template:
dotnet new sweb.angular -n HelloWorldApplicationThen just run project via F5 (it will download all required nuget and npm packages at first build).
[Get("api/v1/weatherTypes")]publicclassSampleDataController:Controller{privatestaticreadonlystring[]Summaries={"Freezing","Bracing","Chilly","Cool","Mild","Warm","Balmy","Hot","Sweltering","Scorching"};publicoverrideControllerResponseInvoke(){try{returnnewJson(items);}catch(Exceptione){Console.WriteLine(e);returnStatusCode(500);}}}
[Post("api/v1/sendMessage")]publicclassSampleDataController:Controller<SampleModel>{publicoverrideControllerResponseInvoke(){try{Trace.WriteLine($"Object with message received:{Model.Message}");returnNoContent();}catch(Exceptione)when(eisModelValidationException||eisNewtonsoft.Json.JsonException){returnStatusCode(400,e.Message);}catch(Exceptione){Console.WriteLine(e);returnStatusCode(500,"Site error!");}}}publicclassSampleModel{[Required]publicstringMessage{get;set;}}
// Controller will be executed only on HTTP GET request like http://mysite.com/about[Get("about")]publicclassAboutController:Controller{publicoverrideControllerResponseInvoke(){// About.tpl content will be inserted into {MainContent} in Master.tplreturnnewStaticTpl("Static/About",StringTable.PageTitleAbout);}}
Runs on any request and adds login panel to a pages
// Controller will be executed on any request and will be launched before other controllers (because they have Priority = 0 by default)[Priority(-1)]publicclassLoginPanelController:AsyncController{publicoverrideasyncTask<ControllerResponse>Invoke(){returnContext.Context.Authentication.User==null// Data from GuestPanel.tpl will be inserted into {LoginPanel} in Master.tpl?newInlineTpl("LoginPanel",awaitTemplateFactory.LoadAsync("Shared/LoginPanel/GuestPanel"))// Data from LoggedUserPanelView will be inserted into {LoginPanel} in Master.tpl:newInlineTpl("LoginPanel",awaitGetView<LoggedUserPanelView>().Get(Context.Context.Authentication.User.Identity.Name));}}
publicclassLoggedUserPanelView:View{publicasyncTask<ITemplate>Get(stringuserName){// Loading template from LoggedUserPanel.tpl asynchronouslyvartpl=awaitTemplateFactory.LoadAsync("Shared/LoginPanel/LoggedUserPanel");// Setting userName into {UserName} variable in LoggedUserPanel.tpltpl.Add("UserName",userName);returntpl;}}
There are many ways in which you can participate in the project. Like most open-source software projects, contributing code is just one of many outlets where you can help improve. Some of the things that you could help out with are:
- Documentation (both code and features)
- Bug reports
- Bug fixes
- Feature requests
- Feature implementations
- Test coverage
- Code quality
- Sample applications
Additional extensions to Simplify.Web live in their own repositories on GitHub. For example:
- Simplify.Web.Json - JSON serialization/deserialization
- Simplify.Web.Multipart - multipart form model binder
- Simplify.Web.MessageBox - non-interactive server side message box
- Simplify.Web.Templates - Visual studio project templates
Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
About
Moved tohttps://github.com/SimplifyNet. Simplify.Web is a lightweight and fast server-side .NET web-framework based on MVC and OWIN for building HTTP based web-applications, RESTful APIs etc.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.