Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 30, 2021. It is now read-only.
/Simplify.WebPublic archive

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

NotificationsYou must be signed in to change notification settings

i4004/Simplify.Web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,092 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simplify.Web

Simplify

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

Package status

Latest versionNuget version
DependenciesLibraries.io dependency status for latest release

Issues

Issues board

Build status

BranchStatus
masterAppVeyor Build status
developAppVeyor Build status

Main features

  • 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

Quick start

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
TemplateShort Name
Angular templatesweb.angular
Api templatesweb.api
Minimal templatesweb.minimal
Windows service hosted api templatesweb.api.windowsservice

Use the short name to create a project based on selected template:

dotnet new sweb.angular -n HelloWorldApplication

Then just run project via F5 (it will download all required nuget and npm packages at first build).

API outgoing JSON controller example

[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);}}}

API ingoing JSON controller example

[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;}}

Some simple HTML generation controllers example

Static page controller

// 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);}}

Any page controller with high run priority example

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));}}

View example

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;}}

Contributing

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

Related Projects

Additional extensions to Simplify.Web live in their own repositories on GitHub. For example:

License

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

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2026 Movatter.jp