c# - Constructor not being called while autowiring in service stack -
i writing service in c# using service stack framework. have class inmemoryfilesystem (https://gist.github.com/elixir24/9457433) trying auto wire.
here relevant portion of class
public class inmemoryfilesystem {
public dictionary<string, userfilesystem> clienttofilesystemmap {get;set;} public datetime lastcheckpoint { get; set; } private static readonly log4net.ilog logger = log4net.logmanager.getlogger(typeof(inmemoryfilesystem)); public inmemoryfilesystem () { clienttofilesystemmap = new dictionary<string, userfilesystem>(); userfilesystem filesystem = new userfilesystem(); filesystem.metadata = new usermetadata("piyush", "password", 1); userfile file = new userfile("/x.txt","piyush"); file.filecontent = utils.getbytearrayfromstring("filecontent"); filesystem.filemap.add("/x.txt", file); this.clienttofilesystemmap.add("piyush", filesystem); } }
the object of class inmemoryfilesytem getting auto wired data members initialize in constructor still null. suspecting maybe default constructor still getting called.
here code use auto wiring - https://gist.github.com/elixir24/9457490
public class apphost : apphostbase { public apphost() : base("hello web services",typeof(cloudfileservice).assembly) { } public override void configure(funq.container container){ plugins.add(new requestlogsfeature()); this.config.defaultcontenttype = "json"; container.registerautowired<inmemoryfilesystem>(); } }
does 1 have idea may causing this?
Comments
Post a Comment