79489588

Date: 2025-03-06 13:57:30
Score: 0.5
Natty:
Report link

Instead of pushing object

[ServiceContract(Namespace = "int:")]
[XmlSerializerFormat]
public interface IUsersService
{
    [OperationContract]
    [FaultContract(typeof(SoapResponse))]
    Task<GetUserSomethingResponse> GetUserSomething(GetUserSomethingQuery query);
}

Separating each parameter and delivering it into constructor with X amount of properties helped.

    ///Interface
    [OperationContract]
    [FaultContract(typeof(SoapResponse))]
    Task<GetUserSomethingResponse> GetUserSomething(string username, string id, bool archive);

///Implementation Method
public async Task<GetUserSomethingQueryResponse> GetUserSomethingQuery(string username, string id, bool archive) 
=> await mediator.Send(new GetUserSomethingQuery(username, id, archive));
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: SimonCrane