One Entity's Operations not working

I have a project with several entities, Operations, Services. Everything works great except for 1 new Operations file I just added: EmailSchedulesOperations.cs. The endpoints defined there don’t show in /metadata or /swagger-ui but all my other endpoints do. Here is the complete text of EmailSchedulesOperations.cs…

using CollectionSites.ServiceModel.Types;
using ServiceStack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CollectionSites.ServiceModel.Operations
{

    [Route("/EmailSchedule/deleteEmailFrequency/{id}", "DELETE")]
    [Authenticate]
    public class DeleteEmailFrequency : IReturn<bool>
    {
        public int id { get; set; }
    }

    [Route("/EmailSchedule/getEmailSavedLayout/{id}", "GET")]
    [Authenticate]
    public class GetEmailSavedLayout : IReturn<EmailSchedule>
    {
        public int id { get; set; }
    }

    [Route("/EmailSchedule", "POST")]
    [Authenticate]
    public class StoreEmailSchedule : IReturn<EmailSchedule>
    {
        public string ToEmailAddress { get; set; }
        
        public string? Frequency { get; set; }
        
        public string? Format { get; set; }

        public int? LayoutParamtersId { get; set; }

        public DateTime? DateTime { get; set; }
    }
}

It’s probably something dumb I’m missing. Any ideas?

Forgot to inherit from ServiceStack.Service in the Service class.

1 Like

Other problems with your DTOs is that you should only use Declarative Validation Attributes like [ValidateIsAuthenticated] to avoid coupling your Service Models to implementation assemblies like ServiceStack.dll. The [Authenticate] attribute can be used to enable authentication on your Service implementations classes.

And your APIs should only return reference types, if you need to you can return a string if you want to return “true” or “OK”.