c# - Simple Injector Web Forms -
okay have ui layer , bll layer.
namespace bll { public class user : iuser { public void dosomething(){} } public interface iuser { void dosomething(); } public static class typeregistry { public static void registertypes(container container) { container.register<iuser, user>(lifestyle.singleton); } } } namespace ui { public partial class login : system.web.ui.page { private iuser user; } }
i can't figure how user not null. have tried making constructor caused error
public login(iuser user){ this.user = user;}
compilation error : login not contain constructor takes 0 arguments
this link helped me answer:
https://simpleinjector.readthedocs.org/en/latest/wpfintegration.html
similar @steven's link
https://simpleinjector.readthedocs.org/en/latest/windowsformsintegration.html
Comments
Post a Comment