Esempio n. 1
0
        /// <summary>
		/// The save Data Record from Android App
		/// </summary>
		/// <param name="record">
		/// The Data Record
		/// </param>
		/// <returns>
		/// The <see cref="bool"/>.
		/// boolean if operation succeeds or fails
		/// </returns>
		public async Task<bool> SaveDataRecord(DataRecord record)
        {                       
            using (var session = this._store.OpenAsyncSession())
            {
                await session.StoreAsync(record);
                await session.SaveChangesAsync();
            }

            return true;
        }
Esempio n. 2
0
 private static int getObjectSize()
 {
     long size = 0;
     DataRecord record = new DataRecord();
     using (Stream stream = new MemoryStream())
     {
         BinaryFormatter formatter = new BinaryFormatter();
         formatter.Serialize(stream, record);
         return Convert.ToInt32(stream.Length);
     }
 }
Esempio n. 3
0
 private static void Service_DataReceived(object sender, DataRecord e)
 {
     RaceDB raceDB = new RaceDB(ConfigurationManager.ConnectionStrings["RaceDB"].ToString(), ConfigurationManager.AppSettings["dbName"]);
     raceDB.SaveDataRecord(e);
 }