c# - Should I hide DTOs and View Models behind interfaces or abstractions? -
in there value in using ioc resolvable interfaces specify dtos? fer example: private readonly igettransactionsquery _query; private readonly icreatetransactioncommand _createcommand; public transactionscontroller( igettransactionsquery query, icreatetransactioncommand createcommand) { _query = query; _createcommand = createcommand; } [enablequery] public iqueryable<itransactionquerymodel> get() { return _query.execute(); } public async task<ihttpactionresult> post(icreatetransactionmodel transaction) { if (!modelstate.isvalid) { return badrequest(modelstate); } await _createcommand.execute(transaction); return created(transaction); } here, using itransactionquerymodel , icreatetransactionmodel, instead of concretions. there business value here? scenarios can benefit approach? can think of few, wanted consensus of use case scenarios note: referring controller "action" methods, not constructor, benefit...