asp.net - Cant register vNext DI services using generics -


before moved aspnet5/vnext used simpleinjector. use simpleinjector register generic validators, using following:

services.addscoped(typeof(ivalidator<>), new list<assembly> { assembly.load("my.other.assembly") }); 

my classes defined in other assembly

public interface imyinterface : ivalidator<myobject> {}  public class myvalidator : imyinterface {    // methods here } 

is possible using standard vnext di system?

yes, possible. take here: http://dotnetliberty.com/index.php/2016/01/11/dependency-scanning-in-asp-net-5/


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -