private void BuildCommandMapper(bool useDefaultSection, string sectionName) { var routes = useDefaultSection ? ConfigurationSectionReader.GetRoutes("commandRoutes") : ConfigurationSectionReader.GetRoutes(sectionName); if (routes == null) { throw new NullReferenceException(); } foreach (RouteConfigurationElement r in routes) { _commandDomainMap = new CommandDomainMap(); _commandDomainMap.DomainClassName = r.DomainClass; _commandDomainMap.DomainClassMethodName = r.DomainClassMethod; _commandDomainMap.CommandName = r.Command; CommandMapper.AddMapping(_commandDomainMap); } }
CommandRouteMapper IMapToAnInstanceMethod.UsingMethod(string methodName) { _commandDomainMap.DomainClassMethodName = methodName; CommandMapper.AddMapping(_commandDomainMap); return(this); }
CommandRouteMapper IMapToAConstructor.To <D>() { _commandDomainMap.DomainClassName = typeof(D).AssemblyQualifiedName; CommandMapper.AddMapping(_commandDomainMap); return(this); }