public void Save(BaseSetup setup, string filepath, string filename) { var prepSetup = _mapper.Map <AccSetup.BaseSetup, AccSetupJson.Root>(setup); var json = JsonSerializer.Serialize <AccSetupJson.Root>(prepSetup); File.WriteAllText($"{filepath}\\{filename}", json); }
public SetupProcessor(BaseSetup baseSetup) { if (baseSetup == null) { throw new ArgumentNullException(nameof(baseSetup)); } _baseSetup = baseSetup; _updatableSetupProperties = new List <UpdatableSetupProperty>(); }
public static void InsertIntoIpGeoTable() { using (var conn = BaseSetup.TestCrateConnection()) { conn.Open(); using (var cmd = new CrateCommand("insert into ip_geopoint (id,ip_addr,pin,dateutc) values ('1','192.168.2.1',[ 46.5, 26.4 ],'1969-12-06')", conn)) { cmd.ExecuteNonQuery(); } } }
public static void CreateIpGeoTable() { using (var conn = BaseSetup.TestCrateConnection()) { conn.Open(); using (var cmd = new CrateCommand("CREATE TABLE ip_geopoint ( id integer, ip_addr string, pin geo_point,dateutc timestamp) with (number_of_replicas = 0)", conn)) { cmd.ExecuteNonQuery(); } } }
public BlendSafeAndAggressive(BaseSetup safeSetup, BaseSetup aggressiveSetup) { if (safeSetup == null) { throw new ArgumentNullException(nameof(safeSetup)); } if (aggressiveSetup == null) { throw new ArgumentNullException(nameof(aggressiveSetup)); } _safeSetup = safeSetup; _aggressiveSetup = aggressiveSetup; }
public static void DropTable(string name) { try { using (var conn = BaseSetup.TestCrateConnection()) { using (var cmd = new CrateCommand("drop table " + name, conn)) { cmd.ExecuteNonQuery(); } } } catch (Exception) { //Bad solution for drop if exists } }
public void AddSourceSetup(BaseSetup sourceBaseSetup) { _rootSetups.Add(sourceBaseSetup); }