static void Main(string[] args) { // PARAMS string connectionStringMongo = "mongodb://192.168.1.105:27017"; string pasteDBLocation = "mongo"; DateTime startDate = new DateTime(2010, 1, 1); TimeSpan startTime = new TimeSpan(0, 0, 0); TimeSpan duration = new TimeSpan(2400, 0, 0); int howManyDaysBack = -100; // CODE DateTime from = startDate.AddTicks(startTime.Ticks); DateTime to = from.AddTicks(duration.Ticks); ICanRead mongoIn = new MongoIn(connectionStringMongo); var data = mongoIn.GetData("Temp", from, to).Result; var list = TransformData(data, howManyDaysBack); ICanStore dataOut = null; if (pasteDBLocation.Equals("mongo")) { dataOut = new MongoOut(connectionStringMongo); } else if (pasteDBLocation.Equals("riak")) { dataOut = new RiakOut(); } dataOut.InsertData("Temp", list).Wait(); }
public ITransferFromOrToSyntax Item(double quantity, ICanStore item) { if (item.UnitsDiscrete && (quantity - Math.Floor(quantity) > double.Epsilon)) throw new ArgumentException(string.Format("Item must be transferred in discrete units, as specified by the UnitsDiscrete property. Value was {0}.", quantity), "quantity"); _quantity = quantity; _item = item; _from = null; return this; }
public ItemStorePartition(ICanStore item, int slots) { Item = item; Slots = slots; }
public ItemStorePartition(ICanStore item) { Item = item; Slots = 1; }