/// <summary> /// Adds new Routes to Database /// </summary> public void AddRouteUri() { List <String> routeList = getControllerNames(); Controller_Reflection_DBEntities3 databaseEntities = new Controller_Reflection_DBEntities3(); foreach (var route in routeList) { var routeUri = databaseEntities.tb_Controller.Where(controllerUri => controllerUri.ControllerUrl == route).FirstOrDefault(); if (routeUri == null) { tb_Controller _Controller = new tb_Controller(); _Controller.ControllerUrl = route; databaseEntities.tb_Controller.Add(_Controller); databaseEntities.SaveChanges(); } } }