﻿using Data;
using Ninject;
using Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace LCAToolAPI.API
{
    public class FragmentTraversalController : ApiController
    {
        [Inject]
        private readonly IFragmentTraversal _fragmentTraversal ;


        public FragmentTraversalController(IFragmentTraversal fragmentTraversal)
        {

            if (fragmentTraversal == null)
            {
                throw new ArgumentNullException("fragmentTraversal is null");
            }

            _fragmentTraversal = fragmentTraversal;

        }

        int scenarioId = 1;

        //GET api/<controller>
        [System.Web.Http.AcceptVerbs("GET", "POST")]
        [System.Web.Http.HttpGet]
        public void Traversal()
        {
            _fragmentTraversal.Traverse(scenarioId);
        }

        //// GET api/<controller>
        //public IEnumerable<string> Get()
        //{
        //    return new string[] { "value1", "value2" };
        //}

        //// GET api/<controller>/5
        //public string Get(int id)
        //{
        //    return "value";
        //}

        //// POST api/<controller>
        //public void Post([FromBody]string value)
        //{
        //}

        //// PUT api/<controller>/5
        //public void Put(int id, [FromBody]string value)
        //{
        //}

        //// DELETE api/<controller>/5
        //public void Delete(int id)
        //{
        //}

    }
}
﻿using Data;
using Ninject;
using Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace LCAToolAPI.API
{
    public class FragmentTraversalController : ApiController
    {
        [Inject]
        private readonly IFragmentTraversal _fragmentTraversal ;


        public FragmentTraversalController(IFragmentTraversal fragmentTraversal)
        {

            if (fragmentTraversal == null)
            {
                throw new ArgumentNullException("fragmentTraversal is null");
            }

            _fragmentTraversal = fragmentTraversal;

        }

        //int scenarioId = 1;

        //GET api/<controller>
        [Route("api/scenarios/{scenarioID}/updatecaches")]
        [System.Web.Http.AcceptVerbs("GET", "POST")]
        [System.Web.Http.HttpGet]
        public void Traversal(int scenarioId)
        {
            _fragmentTraversal.Traverse(scenarioId);
        }

        //// GET api/<controller>
        //public IEnumerable<string> Get()
        //{
        //    return new string[] { "value1", "value2" };
        //}

        //// GET api/<controller>/5
        //public string Get(int id)
        //{
        //    return "value";
        //}

        //// POST api/<controller>
        //public void Post([FromBody]string value)
        //{
        //}

        //// PUT api/<controller>/5
        //public void Put(int id, [FromBody]string value)
        //{
        //}

        //// DELETE api/<controller>/5
        //public void Delete(int id)
        //{
        //}

    }
}
Add route for updating caches via fragment traversal
WebAPI: Add route for updating caches via fragment traversal
