Exemple #1
0
        public void TestAllAreas()
        {
            var controller = new AreaController(new RiskAntwerpRest_dbContext());

            var actionResult = controller.GetAllAreas();

            actionResult.Should().BeOfType <OkObjectResult>();
        }
        public string[] Get(bool strings)
        {
            List <Area>   areas     = areaController.GetAllAreas();
            List <string> areaNames = new List <string>();

            foreach (Area area in areas)
            {
                areaNames.Add(area.name);
            }
            return(areaNames.ToArray());
        }
Exemple #3
0
        public IActionResult Get(int id)
        {
            List <Area>   allAreas = areaController.GetAllAreas();
            List <string> allNames = new List <string>();

            foreach (Area area in allAreas)
            {
                allNames.Add(area.name);
            }
            return(Ok(new TestObject {
                name = string.Join(",", allNames.ToArray()), age = 2
            }));
        }