public PomonaSessionFactory(TypeMapper typeMapper, Route routes, IRouteActionResolver actionResolver) { TypeMapper = typeMapper; ActionResolver = actionResolver; Routes = routes; this.pipeline = new DefaultRequestProcessorPipeline(); this.serializerFactory = new PomonaJsonSerializerFactory(); }
public EnumType(Type mappedType, TypeMapper typeMapper, Dictionary<string, int> enumValues) { if (mappedType == null) throw new ArgumentNullException("targetType"); if (typeMapper == null) throw new ArgumentNullException("typeMapper"); if (enumValues == null) throw new ArgumentNullException("enumValues"); if (!mappedType.IsEnum) throw new ArgumentException("Type is not enum.", "targetType"); this.mappedType = mappedType; this.typeMapper = typeMapper; this.enumValues = enumValues; }
protected PomonaModule( IPomonaDataSource dataSource, TypeMapper typeMapper) { // HACK TO SUPPORT NANCY TESTING (set a valid host name) Before += ctx => { if (String.IsNullOrEmpty(ctx.Request.Url.HostName)) ctx.Request.Url.HostName = "test"; return null; }; this.dataSource = dataSource; this.typeMapper = typeMapper; foreach (var transformedType in this.typeMapper .TransformedTypes.OfType<ResourceType>() .Select(x => x.UriBaseType) .Where(x => x != null && !x.IsAnonymous() && x.IsRootResource) .Distinct()) RegisterRoutesFor(transformedType); Get["/schemas"] = x => GetSchemas(); Get[String.Format("/{0}.dll", this.typeMapper.Filter.GetClientAssemblyName())] = x => GetClientLibrary(); RegisterClientNugetPackageRoute(); Get["/"] = x => GetJsonBrowserHtmlResponse(); RegisterResourceContent("antlr3-all-min.js"); RegisterResourceContent("antlr3-all.js"); RegisterResourceContent("PomonaQueryJsLexer.js"); RegisterResourceContent("PomonaQueryJsParser.js"); RegisterResourceContent("QueryEditor.css"); RegisterResourceContent("QueryEditor.js"); }
public TestPomonaModule(IPomonaDataSource dataSource, TypeMapper typeMapper) : base(dataSource, typeMapper) { }
public virtual void OnMappingComplete(TypeMapper typeMapper) { }
public TestPomonaBootstrapper(ISessionFactory sessionFactory) { this.sessionFactory = sessionFactory; typeMapper = new TypeMapper(new TestPomonaConfiguration()); }
protected PomonaModule(IPomonaDataSource dataSource, TypeMapper typeMapper, string modulePath) : this(typeMapper.SessionFactory, modulePath, dataSource) { }
protected PomonaModule(IPomonaDataSource dataSource, TypeMapper typeMapper) : this(dataSource, typeMapper, "/") { }