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 8375671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:14:10+00:00 2026-06-09T15:14:10+00:00

All the examples of WebAPI I have seen show how to have a basic

  • 0

All the examples of WebAPI I have seen show how to have a basic CRUD setup with a controller. For example the controller below shows a controller for campaigns in my application:

public IEnumerable<CampaignModel> Get()
{
    return _campaignService.GetAll();
}

public CampaignModel Get(int id)
{
    return _campaignService.GetByID(id);
}

public void Post(CampaignModel campaign)
{
    _campaignService.Create(campaign);
}

public void Put(CampaignModel campaign)
{
    _campaignService.Update(campaign);
}

public void Delete(int id)
{
    _campaignService.Delete(id);
}

This is all well and good, and I end up with a few nice endpoints in the following format:

  • GET campaigns/
  • GET campaigns/{id}
  • POST campaigns/{campaign}
  • PUT campaigns/{campaign}
  • DELETE campaigns/{id}

However, I now want to extend the api further and add the following endpoints:

  • POST campaigns/send
  • POST campaigns/schedule/{date}

Is it possible to have these as part of the same controller as the CRUD actions above? Or do I have to add other controllers to and then set up a route for each of these endpoints?

  • 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-09T15:14:12+00:00Added an answer on June 9, 2026 at 3:14 pm

    Check out “Routing by Action Name” over here

    routes.MapHttpRoute(
        name: "ActionApi",
        routeTemplate: "api/{controller}/{action}/{id}",
        defaults: new { id = RouteParameter.Optional }
    );
    
    public class CampaignsController : ApiController
    {
        [HttpPost]
        public void send();
    
        [HttpPost]
        public void schedule(DateDto date);
    }
    

    will map to “api/campaigns/send” and “api/campaigns/schedule”

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

Sidebar

Related Questions

All the examples I have seen where the PropertyPlaceHolderConfigurer is used seem to be
Suppose we have abstract class A (all examples in C#) public abstract class A
All the examples I've come across using Google Maps API seem to show a
I have installed WCF Web API Preview 5 using NuGet Visual Studio extension (WebApi.All).
All examples are taken from the SICP Book: http://sicpinclojure.com/?q=sicp/1-3-3-procedures-general-methods This was motivated from the
I want to use CKEditor with DynamicData Web Site. The all examples that I
I'm using opengl and trying to create a first person camera. All examples use
I am trying to find rectangle buttons with gloss effect. all examples are relevant
I've read through the Google Spreadsheets API PHP documentation. All examples are using Zend,
Is there any way to compute length of va_list ? All examples I saw

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.