Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8094693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:52:38+00:00 2026-06-05T20:52:38+00:00

I am looking for the C# equivalent of Spring MVC’s url mapping using annotations

  • 0

I am looking for the C# equivalent of Spring MVC’s url mapping using annotations, i.e in Java I can write:

@Controller
@RequestMapping("/some-friendly-url/")
class MyController
{
    @RequestMapping(value = "/{type}/more-seo-stuff/{color}", method = RequestMethod.GET)
    public List<SomeDTO> get(@PathVariable String type,
                             @PathVariable String color,
                             int perPage) {
        ...
    }

    @RequestMapping(method = RequestMethod.POST)
    public String post(@RequestBody SomeDTO somethingNew) {
        ...
    }
}

It’s actually much more powerful than this simple example as anyone familiar the the concept knows.

I’ve tried to search on how to achieve the same with either ASP.MVC 3 or with MonoRail and both frameworks seem to be based on RoR’s convention-over-configuration “//” philosophy and it would be hard to achieve the above with them and require a lot of bespoke routing entries outside the controller class with only a small subset of the functionality available via attributes. Spring.NET does not seem to address this either stating that ASP.MVC’s routing functionality is sufficient.

Is there anything out there in the C# world that provides this type of functionality? I was just about to start looking into writing something of my own to address this, but I was hoping not to have to do that.

Edit: Finally found the “AttributeRouting” project which is available on NuGet as well: https://github.com/mccalltd/AttributeRouting/wiki/1.-Getting-Started. Works perfectly. Doesn’t support to full range of features that Spring MVC does, but supports most of it.

Also Akos Lukacs pointed to another good library below by ITCloud. However that one unfortunately is not available on NuGet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:52:40+00:00Added an answer on June 5, 2026 at 8:52 pm

    I Eventually used https://github.com/mccalltd/AttributeRouting/wiki/1.-Getting-Started. Posting this only now for the sake of keeping the question complete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for the equivalent of Python decorators / Lisp macros / Java annotations
I'm looking for a book (or equivalent) to help me go from using hg
For example, I am looking for an Appfuse equivalent for .NET MVC apps. I
I'm looking for the equivalent to the PHP function mysql_real_escape_string() to use in C#.NET.
I'm looking for an equivalent of PerlCritic for PHP. PerlCritc is a static source
I'm looking for the equivalent of what in js would be 'this is a
I'm looking for the equivalent of [\w]&&[^\d] (Of course && is not a regex
I am looking for an equivalent pattern in multi-threading in iOS as there is
Looking for a RAM disk API (or equivalent set of software to implement) to
I'm looking to do the equivalent of Python's inspect.getargspec() in Javascript. I do know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.