0

As you can see in Versioning gRPC services, in GRPC we can use versioning by defining package in a proto file.

How can I achieve the same functionality in a code-first approach?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sorosh_sabz
  • 2,356
  • 2
  • 32
  • 53

1 Answers1

1

You can use some approaches for meeting your requirements.

First with Service[greet.V1]:

namespace BSN.Resa.Cas.AppService.Contract
{
    [ServiceContract("BSN.Resa.Cas.V1")]
    public interface ICaptchaQueryService
    {
        Task<Response<CaptchaVerifyViewModel>> VerifyAsync(CaptchaQueryServiceVerifyRequest request);
    }
}

Second with namespace gree.V1:

namespace BSN.Resa.Cas.AppService.Contract.V1
{
    [ServiceContract]
    public interface ICaptchaQueryService
    {
        Task<Response<CaptchaVerifyViewModel>> VerifyAsync(CaptchaQueryServiceVerifyRequest request);
    }
}

Third, you can change the name interface to combine with a version, for example, ICaptchaQueryService to ICaptchaQueryServiceV1.

In the end, you can combine some of above methods together as you need.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sorosh_sabz
  • 2,356
  • 2
  • 32
  • 53