79540979

Date: 2025-03-28 09:14:49
Score: 1
Natty:
Report link
  1. Extract the common logic into a separate shared library (e.g., a .ClassLib project).

    Both Project A and Project B reference this library.

    • No HTTP overhead, no duplication, guaranteed consistency.
  2. If a shared library isn’t possible, use conditional dependency injection:

    In Project A, inject the direct implementation (no HTTP).

    In Project B, inject the Typed HTTP Client (calls Project A’s API).

    Ensures the same logic is executed in both cases.

Why Avoid Self-HTTP Calls?

Alternative: MediatR (In-Process Mediator)

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user30090745