Ssutil.exe can we include the interface implementation has part of the class

I use ssutil to generate my class for my xamarin apps.

In my service model project I have this definition:

    namespace LanBO.ServiceModel.Tables
    {
        public class Application: BackOfficeFields, IApplication, IConcurrency
        {
...

When I use SSUtil It generate:

namespace LanBO.ServiceModel.Tables
{
	public partial class Application: BackOfficeFields 
    {

Is it possible to keep the interface Implementation in the generated file.

Thanks

Note ssutil.exe is deprecated, we recommend switching over to using https://github.com/ServiceStack/servicestack-cli in future:

$ npm install -g @servicestack/cli

Then you can add file references with the same format, e.g. for C# references:

csharp-ref baseUrl Name

This wont change what’s generated but it’s our only cross-platform CLI tool that’s maintained.

We can generate some “clean” interfaces. Are you using the latest version and are IApplication and IConcurrency your own custom interfaces? If so what’s their definition?

OK I will try the new tools.

IApplication and IConcurency are my own. There were included in my .dtos.cs file
Definition are simple fields

Does not work with the new tools I still loose the interface.
My base class BackOfficeFields is generated but not the following interfaces.

This is my original class

using LanBO.ServiceModel.Interface.Tables;
using ServiceStack.DataAnnotations;

    namespace LanBO.ServiceModel.Tables
    {
        public class Application: BackOfficeFields, IApplication, IConcurrency
        {
            [Unique, Required]
            public string ApplicationCode { get;  set; }  
            [Required]
            public string ApplicationDescription { get; set; }  
            public bool Active { get; set; }
            public ulong RowVersion { get; set; }
    
            public Application(string applicationCode)
            {
                ApplicationCode = applicationCode;
                Active = true;            
            }
            public Application() { }
        }
    }

The new tool doesn’t change what’s generated which is generated by your ServiceStack instance. Only upgrading your ServiceStack version will make a difference. I’m not sure why your interfaces are not being generated though.

What’s the definition of IApplication and IConcurrency?

namespace LanBO.ServiceModel.Interface.Tables
{
    public interface IApplication
    {
        string ApplicationCode { get;  set; }  
        string ApplicationDescription { get; set; }  
        bool Active { get; set; }
    }
}

namespace LanBO.ServiceModel.Interface.Tables
{

    public  interface IConcurrency
    {

        /// <summary>
        /// Gets or sets the row version. Will be use for optimistics concurrency
        /// </summary>
        /// <value>The row version.</value>
        ulong RowVersion { get; set; }
    }
}

I’m running on .Net Core with SS 5.1.1

Interfaces were limited on Request DTOs but I’ve just expanded them to other Types as well so they should now be included if you update to the latest v5.1.1 that’s now available on MyGet.

1 Like

Work like a charm your the best!