I have a class that inherits many classes interfaces, and I want to instantiate it to use only one method, how should I do it? Is it possible to do it without passing all the necessary parameters?
public class PontoSituacaoService : IPontoSituacaoService,
IMessageHandler<DespachoCreatedEvento, bool>,
IMessageHandler<OcorrenciaAssociadaEvento, bool>,
IMessageHandler<OcorrenciaDesassociadaEvento, bool>,
IMessageHandler<PartilharOcorrenciaEvento, bool>,
IMessageHandler<GrupoDespachosCreatedEvento, bool>,
IMessageHandler<AlteracaoEstadoOcorrencia, bool>,
IMessageHandler<NotificacaoManualEvento, bool>,
IMessageHandler<OcorrenciaImportanciaModificadaEvento, bool>,
IMessageHandler<AtualizarPOSITOcorrencia112, bool>,
IMessageHandler<DanoHabitacionalCriadoEvento, bool>
{
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly IRepository<PontoSituacao> _pontoSituacaoRepository;
private readonly IRepository<SumarioPontoSituacao> _sumarioPontoSituacaoRepository;
private readonly IOcorrenciaService _ocorrenciaService;
private readonly ILookupService<TipoPontoSituacao> _tipoPontoSituacaoService;
private readonly IModuloInterfacePortal _moduloInterfacePortal;
private readonly ILookupService<TemplateNotificacaoSINOP> _templateService;
private readonly IMessageBus _bus;
public PontoSituacaoService(IRepository<PontoSituacao> pontoSituacaoRepository,
IOcorrenciaService ocorrenciaService,
ILookupService<TipoPontoSituacao> tipoPontoSituacaoService,
IMessageBus bus,
IModuloInterfacePortal moduloInterfacePortal,
IRepository<SumarioPontoSituacao> sumarioPontoSituacaoRepository,
ILookupService<TemplateNotificacaoSINOP> templateService)
{
_pontoSituacaoRepository = pontoSituacaoRepository;
_sumarioPontoSituacaoRepository = sumarioPontoSituacaoRepository;
_ocorrenciaService = ocorrenciaService;
_tipoPontoSituacaoService = tipoPontoSituacaoService;
_bus = bus;
_moduloInterfacePortal = moduloInterfacePortal;
_templateService = templateService;
}
public ActionConfirmation SaveOrUpdate(PontoSituacao pontoSituacao)
{
return SaveOrUpdate(pontoSituacao, true, false);
}
}