Наследование: Pomona.Common.TypeSystem.ExportedTypeResolverBase
Пример #1
0
 public PomonaSessionFactory(TypeMapper typeMapper, Route routes, IRouteActionResolver actionResolver)
 {
     TypeMapper = typeMapper;
     ActionResolver = actionResolver;
     Routes = routes;
     this.pipeline = new DefaultRequestProcessorPipeline();
     this.serializerFactory = new PomonaJsonSerializerFactory();
 }
Пример #2
0
        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;
        }
Пример #3
0
        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");
        }
Пример #4
0
 public TestPomonaModule(IPomonaDataSource dataSource, TypeMapper typeMapper)
     : base(dataSource, typeMapper)
 {
 }
Пример #5
0
 public virtual void OnMappingComplete(TypeMapper typeMapper)
 {
 }
Пример #6
0
 public TestPomonaBootstrapper(ISessionFactory sessionFactory)
 {
     this.sessionFactory = sessionFactory;
     typeMapper = new TypeMapper(new TestPomonaConfiguration());
 }
Пример #7
0
 protected PomonaModule(IPomonaDataSource dataSource, TypeMapper typeMapper, string modulePath)
     : this(typeMapper.SessionFactory, modulePath, dataSource)
 {
 }
Пример #8
0
 protected PomonaModule(IPomonaDataSource dataSource, TypeMapper typeMapper)
     : this(dataSource, typeMapper, "/")
 {
 }