سؤال

My project contains a large set of services which we've grouped into different domains which allows us to call them using corressponding Urls i.e.

Domain 1

/FlightManagementDomain/SeatMaps
/FlightManagementDomain/Passengers

Domain 2

/ReservationsDomain/Tickets
/ReservationsDomain/Bookings

I could let teams of developers work on each namespace. No errors get thrown even if two teams create two classes with the same name in each namespace for request/response/controller objects.

Since I wanted to switch over to service stack I wrote a POC using SS with the following structure

Solution Structure

Note that I'm using the same name for the request object "GetUsersRequest". This compiles and runs fine but when I click the json or xml links in the metadata page, it throws the following error "Sequence contains more than one matching element"

Error

The Service Host configuration looks like this

Configuration

Now if I change one of the class names from "GetUsersRequest" to "GetUsersRequest1" it works as expected and the error goes away.

I have a doubt that SS is using Type.Name instead of Type.FullName somewhere in the code. Is there a way to avoid this error without renaming the request class?

I've attached the complete source code here link to source code

هل كانت مفيدة؟

المحلول

This wont work because Request DTO Names must be unique in ServiceStack. C# Namespaces are internal implementation detail and do not carry any meaning over the wire.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top