Lamar register service with interface having multiple parameters

141 Views Asked by At

Brief Intro - we are using Lamar as IoC container.

I am looking for some help to understand how to register a service which implements interfaces with multiple parameters. my interface =>

interface IEntityCompareService<G, in T1, in T2> { IList<G> Compare(T1 previous, T2 current); }

and my implementation goes like this,

class ComparisonService : IEntityChangeCompareService<Template G, model A, model B>

I am not able to find any way to register this service. Any help is appreciated.

1

There are 1 best solutions below

0
Anshul On

I got the answer to my question from another source. Adding it here so it might be helpful to others facing similar issue,

For<IEntityChangeCompareService<Template, TypeA, TypeB>().Use<ComparisonService>()

I tested this in my code, and it works well.