namespace MessengerApi.Contracts.MessageParser { /// /// A tool that helps converting POCO request/response models into , and back. /// /// /// If you implement this, it's gonna be a lot easier for you to translate /// dumb request class into , then convert /// back to request at server-side, and do the /// same with the response all the way down to the client. /// public interface IMessageParser { OutboxMessage GetMessageFromRequest(TRequest request, int targetUserId); TRequest GetRequestFromMessage(InboxMessage message); OutboxMessage GetMessageFromResponse(TResponse response, string apiKey, int targetUserId, InboxMessage requestOrigin = null); TResponse GetResponseFromMessage(InboxMessage message); } }