★ wanayoo — archive 1999 https://github.com/developeramarish/Simplify.WebNouvelle recherche | Portail wanayoo
Skip to content
master
Go to file
Code
This branch is 30 commits behind i4004:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Simplify.Web

Simplify

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.

This project is a continuator of AcspNet web-framework

Package status

Latest version Nuget version
Dependencies NuGet Status

Issues status

Ready issues
Stories in Ready

Build status

Branch .NET (4.6.2)
master AppVeyor Build status
develop AppVeyor Build status

Main features

  • Comes as Microsoft.AspNetCore OWIN middleware
  • Can be used as an API backend only with other front-end frameworks
  • Based on MVC and MVVM patterns
  • Lightweigh & 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 page
  • Localization-friendly (supports templates, string table and data files localization by default)
  • Uses fast templates engine (Simplify.Templates)
  • Mocking-friendly
  • Mono-friendly

Getting started

Below is the list of sample applications showing different variations of Simplify.Web usage

Getting started page

Just some simple controllers example

Simple static page controller

// Controller will be executed only on HTTP GET request like http://mysite.com/about
[Get("about")]
public class AboutController : Controller
{
    public override ControllerResponse Invoke()
    {
        // About.tpl content will be inserted into {MainContent} in Master.tpl
        return new StaticTpl("Static/About", StringTable.PageTitleAbout);
    }
}

API controller example

[Get("api/weatherTypes")]
public class SampleDataController : Controller
{
    private static readonly string[] Summaries =
    {
        "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
    };

    public override ControllerResponse Invoke()
    {
        try
        {
            return new Json(items);
        }
        catch (Exception e)
        {
            Console.WriteLine(e);

            return StatusCode(500);
        }
    }
}

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)]
public class LoginPanelController : AsyncController
{
    public override async Task<ControllerResponse> Invoke()
    {
        return Context.Context.Authentication.User == null
            // Data from GuestPanel.tpl will be inserted into {LoginPanel} in Master.tpl
            ? new InlineTpl("LoginPanel", await TemplateFactory.LoadAsync("Shared/LoginPanel/GuestPanel"))
            // Data from LoggedUserPanelView will be inserted into {LoginPanel} in Master.tpl
            : new InlineTpl("LoginPanel", await GetView<LoggedUserPanelView>().Get(Context.Context.Authentication.User.Identity.Name));
    }
}

View example

public class LoggedUserPanelView : View
{
    public async Task<ITemplate> Get(string userName)
    {
        // Loading template from LoggedUserPanel.tpl asynchronously
        var tpl = await TemplateFactory.LoadAsync("Shared/LoginPanel/LoggedUserPanel");

        // Setting userName into {UserName} variable in LoggedUserPanel.tpl
        tpl.Add("UserName", userName);

        return tpl;
    }
}

Detailed documentation

About

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.

Resources

License

Packages

No packages published
You can’t perform that action at this time.