So I have an AppointmentController which has an action AcceptAppointment. The method should be POST. But everytime I click on the ActionLink in my Razor Page I get the following error. **This page isn’t working If the problem continues, contact the site owner.
HTTP ERROR 405**

Here is my controller:

```
[Authorize]
public class AppointmentController : Controller
{
    private readonly IAppointmentsService appointmentsService;

    public AppointmentController(IAppointmentsService appointmentsService)
    {
        this.appointmentsService = appointmentsService;
    }

    public IActionResult Index()
    {
        return this.View();
    }

    public IActionResult GetAppointmentFromNotification(string id)
    {
        var notification = this.appointmentsService.GetAppointmentFromNotificationById(id);
        var startTimeMinutes = notification.StartTime.Minute == 0 ? "00" : notification.StartTime.Minute.ToString();
        var endTimeMinutes = notification.EndTime.Minute == 0 ? "00" : notification.EndTime.Minute.ToString();

        var startTime = notification.StartTime.Hour.ToString() + ":" + startTimeMinutes;
        var endTime = notification.EndTime.Hour.ToString() + ":" + endTimeMinutes;

        var viewModel = new AppointmentControlViewModel
        {
            Id = notification.Id,
            Date = notification.Date.ToString("dddd, dd MMMM yyyy", new CultureInfo("bg-BG")),
            StartTime = startTime,
            EndTime = endTime,
            Dogsitter = notification.Dogsitter,
            Owner = notification.Owner,
        };

        return this.View(viewModel);
    }

    [HttpPost]
    public async Task<IActionResult> AcceptAppointment(string id)
    {
        var requestedAppointment = this.appointmentsService.GetAppointmentFromNotificationById(id);

        var appointment = new Appointment
        {
            Status = AppointmentStatus.Unprocessed,
            Timer = 0,
            Date = requestedAppointment.Date,
            StartTime = requestedAppointment.StartTime,
            EndTime = requestedAppointment.EndTime,
            OwnerId = requestedAppointment.OwnerId,
            DogsitterId = requestedAppointment.DogsitterId,
        };

        var notificationToOwner = new Notification
        {
            ReceivedOn = DateTime.UtcNow,
            Content = $"Your request has been sent to <p class=\"text-amber\">{requestedAppointment.Dogsitter.FirstName}</p>",
            OwnerId = requestedAppointment.OwnerId,
            DogsitterId = requestedAppointment.DogsitterId,
        };

        await this.appointmentsService.CreateNewAppointment(appointment);
        await this.appointmentsService.RemoveNotification(requestedAppointment);
        await this.appointmentsService.SendNotificationForAcceptedAppointment(notificationToOwner);

        return this.RedirectToAction("Index");
    }

    [HttpPost]
    public async Task<IActionResult> RejectAppointment(string id)
    {
        var requestedAppointment = this.appointmentsService.GetAppointmentFromNotificationById(id);

        var notificationToOwner = new Notification
        {
            ReceivedOn = DateTime.UtcNow,
            Content = $"Вашата заявка до <p class=\"text-amber\">{requestedAppointment.Dogsitter.FirstName} беше <b class=\"red-text\">отхвърлена</b></p>",
            OwnerId = requestedAppointment.OwnerId,
            DogsitterId = requestedAppointment.DogsitterId,
        };

        await this.appointmentsService.RemoveNotification(requestedAppointment);
        await this.appointmentsService.SendNotificationForAcceptedAppointment(notificationToOwner);

        return this.RedirectToAction("Index");
    }
}

```

**Here is my Razor View:**

```
@model DogCarePlatform.Web.ViewModels.Dogsitter.AppointmentControlViewModel
@{
ViewData["Title"] = "GetAppointmentFromNotification";
Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="col s6 m6 center">
<div class="row center">
    <div class="col s12 ">
        <div class="card hoverable #4db6ac teal lighten-2">
            <div class="card-content white-text">
                <span class="card-title">Уговаряне на дата и час за гледане на кучета</span>
                <p class="row">
                    Моля изберете дали искате уговорката да бъде записана или не. Ако желаете да потвърдите уговорката за дадената дата моля натиснете бутон "Приемам". В противен случай изберете бутон "Отказвам".
                    <h5 class="row">
                        <b class="col s6">Начален час: <b class="orange-text text-darken-1">@Model.StartTime</b> @Model.Date</b>
                        <b class="col s6">Краен час: <b class="orange-text text-darken-1">@Model.EndTime</b> @Model.Date</b>
                    </h5>

                </p>
            </div>
            <div class="card-action">
                <a asp-controller="Appointment" asp-action="RejectAppointment" asp-route-id="@Model.Id"><b>Отказвам</b></a>
                <a style="border-left:1px solid #fb8c00;height:500px"></a>
                <a asp-controller="Appointment" asp-action="AcceptAppointment" asp-route-id="@Model.Id"><b>Приемам</b></a>
            </div>
        </div>
    </div>
</div>

```

**Here are my endPoints:**

```
app.UseEndpoints(
            endpoints =>
                {
                    endpoints.MapControllerRoute("areaRoute", "{area:exists}/{controller=Home}/{action=Index}/{id?}");
                    endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
                    endpoints.MapRazorPages();
                    endpoints.MapHub<NotificationHub>("/notificationHub");
                });

```

**Note:** I am using Microsoft.Extensions.Proxies since I was having some entity loading issues with the DB and nothing would work not even .Include nor Virtual properties.

I am really stuck on this one. Thanks in advance!!