private void OnEnable()
 {
     _target   = (ContextGraph)target;
     _nodes    = serializedObject.FindProperty("_nodes");
     _edges    = serializedObject.FindProperty("_edges");
     _rootNode = serializedObject.FindProperty("_rootNode");
 }
        public static void Load(ContextGraph g)
        {
            var w = EditorWindowBase.InitWindow <EditorWindow_ContextGraph>("✪ Context Graph");

            // var w = EditorWindowBase.InitWindow<EditorWindow_ContextGraph>("◉ Context Graph");
            w._currentGraph = g;
        }
Пример #3
0
        public IJsonApiContext ApplyContext <T>(object controller)
        {
            if (controller == null)
            {
                throw new JsonApiException(500, $"Cannot ApplyContext from null controller for type {typeof(T)}");
            }

            ControllerType = controller.GetType();

            var context = _httpContextAccessor.HttpContext;
            var path    = context.Request.Path.Value.Split('/');

            RequestEntity = ContextGraph.GetContextEntity(typeof(T));

            if (context.Request.Query.Any())
            {
                QuerySet = new QuerySet(this, context.Request.Query);
                IncludedRelationships = QuerySet.IncludedRelationships;
            }

            var linkBuilder = new LinkBuilder(this);

            BasePath           = linkBuilder.GetBasePath(context, RequestEntity.EntityName);
            PageManager        = GetPageManager();
            IsRelationshipPath = path[path.Length - 2] == "relationships";
            return(this);
        }
        public IContextGraph Build()
        {
            // this must be done at build so that call order doesn't matter
            _entities.ForEach(e => e.Links = GetLinkFlags(e.EntityType));

            var graph = new ContextGraph(_entities, _usesDbContext, _validationResults);

            return(graph);
        }
Пример #5
0
        public IContextGraph Build()
        {
            var graph = new ContextGraph()
            {
                Entities      = _entities,
                UsesDbContext = _usesDbContext
            };

            return(graph);
        }
Пример #6
0
        public IContextGraph Build()
        {
            // this must be done at build so that call order doesn't matter
            _entities.ForEach(e => e.Links = GetLinkFlags(e.EntityType));

            var graph = new ContextGraph()
            {
                Entities      = _entities,
                UsesDbContext = _usesDbContext
            };

            return(graph);
        }
Пример #7
0
        public IJsonApiContext ApplyContext <T>()
        {
            var context = _httpContextAccessor.HttpContext;

            RequestEntity = ContextGraph.GetContextEntity(typeof(T));

            if (context.Request.Query.Any())
            {
                QuerySet = new QuerySet(this, context.Request.Query);
                IncludedRelationships = QuerySet.IncludedRelationships;
            }

            var linkBuilder = new LinkBuilder(this);

            BasePath = linkBuilder.GetBasePath(context, RequestEntity.EntityName);

            return(this);
        }
Пример #8
0
        public IJsonApiContext ApplyContext <T>()
        {
            var context = _httpContextAccessor.HttpContext;
            var path    = context.Request.Path.Value.Split('/');

            RequestEntity = ContextGraph.GetContextEntity(typeof(T));

            if (context.Request.Query.Any())
            {
                QuerySet = new QuerySet(this, context.Request.Query);
                IncludedRelationships = QuerySet.IncludedRelationships;
            }

            var linkBuilder = new LinkBuilder(this);

            BasePath           = linkBuilder.GetBasePath(context, RequestEntity.EntityName);
            PageManager        = GetPageManager();
            IsRelationshipPath = path[path.Length - 2] == "relationships";
            return(this);
        }
Пример #9
0
 public ContextGraph(GraphContext parent, ContextGraph other)
     : base(other, true)
 {
     this.Parent = parent;
 }