2

Background/Problem

I've created a couple services with ServiceStack and I wanted to inherit a base class.

the problem is that this base class has a couple methods that unfortinuetly I can't really change the names of easily.

One of these method names happens to be Update, and another happens to be Delete.

This is fine as far as the service goes because I don't have an actual Update method I plan on using in my service, and the Delete method that I would use for the service takes different parameters.

The problem is that

  1. I can't re-use this base class in another service because then it's recognized as using the same RequestDTO for these methods, and

  2. These are methods I don't want to expose as part of the service.

My Question

Is there an attribute or something similar I can use to have ServiceStack ignore these methods? Something similar to a [IgnoreMethod]?

And if not, is there a simple way to change the default mapping of ServiceStack just using any method it finds named Get/Post/Delete/Update ect?

For example how would I get a method like public ResponseDTO GetEntity(RequestDTO request) used as the default Get method instead of the current public object Get(params)

Kyle Gobel
  • 5,530
  • 9
  • 45
  • 68
  • This doesn't answer some of your specific questions about changing ServiceStack's behavior, but why not [employ the Facade pattern to keep your ServiceStack service classes--your public interface--clean](http://stackoverflow.com/a/9709236/795339)? Have that existing class be a property of your service classes, and have clean Get/Put/Post/Delete/All methods in your service classes that call the appropriate methods on the shared class to do the work. – Mike Mertsock Oct 27 '13 at 19:33
  • Thanks, yeah that is probably the better solution anyway, I'll probably change it to something 'cleaner'. Still curious if there's anyway to change the default methods that get used for the HTTP verbs though. – Kyle Gobel Oct 27 '13 at 21:35

0 Answers0