private static void Remove() { var env = new LMConnect.Environment { //LMPoolPath = String.Format(@"{0}", @"C:\LMs\"), LMPoolPath = String.Format(@"{0}", @"c:\LMs"), LMPath = String.Format("{0}/../{1}", System.AppDomain.CurrentDomain.BaseDirectory, "LISp Miner"), }; foreach (var path in Directory.GetDirectories(env.LMPoolPath)) { try { var directory = new DirectoryInfo(path); var lm = new LISpMiner.LISpMiner(directory, env); lm.Dispose(); System.Console.WriteLine(lm.Id); } catch (Exception ex) { System.Console.WriteLine(String.Format("skipping {0} {1}", path, ex.Message)); } } }
public static void Register(HttpConfiguration config, ISessionFactory sessionFactory, LMConnect.Environment environment) { config.Routes.MapHttpRoute( name: "MinersApi", routeTemplate: "miners/{minerId}/{controller}/{taskType}/{taskName}/{action}", defaults: new { controller = "Miners", minerId = RouteParameter.Optional, taskType = RouteParameter.Optional, taskName = RouteParameter.Optional, action = RouteParameter.Optional } ); config.Routes.MapHttpRoute( name: "UsersApi", routeTemplate: "users/{username}/{controller}/{id}", defaults: new { controller = "Users", username = RouteParameter.Optional, id = RouteParameter.Optional } ); config.Formatters.Remove(config.Formatters.JsonFormatter); config.Formatters.Remove(config.Formatters.XmlFormatter); config.Formatters.Add(new RequestMediaTypeFormatter()); config.Formatters.Add(new ResponseMediaTypeFormatter()); config.Filters.Add(new ApiErrorHandlerAttribute()); SessionFactory = sessionFactory; Environment = environment; }
private static void Remove() { var env = new LMConnect.Environment { //LMPoolPath = String.Format(@"{0}", @"C:\LMs\"), LMPoolPath = String.Format(@"{0}", @"c:\LMs"), LMPath = String.Format("{0}/../{1}", System.AppDomain.CurrentDomain.BaseDirectory, "LISp Miner"), }; foreach (var path in Directory.GetDirectories(env.LMPoolPath)) { try { var directory = new DirectoryInfo(path); var lm = new LISpMiner.LISpMiner(directory, env); lm.Dispose(); System.Console.WriteLine(lm.Id); } catch (Exception ex) { System.Console.WriteLine(String.Format("skipping {0} {1}", path, ex.Message)); } } }