Esempio n. 1
0
        public void SetDatastore(ISqlDataStore value)
        {
            _datastore = value;
            var entityInfo = GetSyncableEntity();

            _entitySerialiazer = new EntityChangesetBuilder(entityInfo, _syncSession);

            if (entityInfo.IsDeleteTrackEnable)
            {
                _entityTombstoneSerialiazer = new EntityChangesetBuilder(entityInfo.EntityTombstoneInfo, _syncSession);
            }
        }
Esempio n. 2
0
 public void ApplyDelete(ISqlDataStore datastore, string entityName, EntityChangesetBuilder entitySerialiazer)
 {
     try
     {
         using (var command = entitySerialiazer.ToDelete(datastore, entityName, this))
         {
             datastore.ExecuteNonQuery(command);
         }
     }
     catch (Exception e)
     {
         throw new Exception(string.Format("Erreur lors de la suppression {0}. Exception: {1}", this, e));
     }
 }
Esempio n. 3
0
 public void ApplyInsert(ISqlDataStore datastore, EntityChangesetBuilder entitySerialiazer)
 {
     try
     {
         DisableAutoIncrement(datastore);
         using (var command = entitySerialiazer.ToInsert(datastore, EntityName, this))
         {
             datastore.ExecuteNonQuery(command);
         }
     }
     catch (Exception e)
     {
         throw new Exception(string.Format("Erreur lors de l'insertion {0}. Exception: {1}", this, e));
     }
     finally
     {
         RestoreAutoIncrement(datastore);
     }
 }