GithubHelp home page GithubHelp logo

anthrax3 / ram.adminframework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ramzess-2/ram.adminframework

0.0 0.0 0.0 17 KB

administration framework for asp.net mvc

License: MIT License

C# 100.00%

ram.adminframework's Introduction

Ram.AdminFramework

Administration framework for asp.net mvc

The basic idea of this library is crating administration dashboard without area named like ##Admin

  • For now is realized only beatiful routing which you can map areas without AreaRegistration class needed*

Example 1: basic HomeController in area Home

public class HomeController: Controller {

       public ActionResult Index() {
           return Content("this is home page... ");
       }

       public ActionResult About() {
           return Content("this is about page... ");
       }

       public ActionResult Contacts() {
           return Content("this is contacts page... ");
       }

   }

And AreaRegistration class

public class HomeAreaRegistration: AreaRegistration {
        public override void RegisterArea(AreaRegistrationContext context) {

            context.Routes.MapRoute("index", "", new {
                controller = "Home", 
                action = "index"
            });

            context.Routes.MapRoute("about", "about", new {
                controller = "Home", 
                action = "about"
            });

            context.Routes.MapRoute("contacts", "contacts", new {
                controller = "Home", 
                action = "contacts"
            });

        }

        public override string AreaName { get; } = "Home";
    }

Now, you can just do this without AreaRegistrationContext class needed

RouteManager.GetProvider()
    .WithArea("Home")
        .WithController("Home")
            .withAction("", "index", "index")
            .withAction("about", "about")
            .withAction("contacts", "contacts");

Or, if you want use routes with same name as controller actions you can use:

RouteManager.GetProvider()
    .WithArea("Home")
    .WithController("Home")
        .withActions("index", "about", "contacts");

It's will be mapped to /index, /about, /contacts

ram.adminframework's People

Contributors

ramzess-2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.