Example #1
0
        public static void InsertInLocal(IDataStore localDataStore, ISyncSessionInfo syncSessionInfo, ISyncable remoteEntity)
        {
            var entityInfo = localDataStore.GetEntityInfo(remoteEntity);

            var mergeResolution = new MergeResolution
            {
                OperationType = OperationTypes.Insert,
                Entity        = EntityChange.Create(entityInfo, remoteEntity)
            };

            mergeResolution.ApplyResolution(localDataStore as ISqlDataStore, syncSessionInfo);
        }
Example #2
0
        public static MergeResolution Create(IEntityInfo entityInfo, OperationTypes operationType, IEntity entity)
        {
            var entitySync = SyncEntity.Create(entityInfo);

            if (entitySync.Direction == SyncDirection.UploadOnly)
            {
                return(null);
            }

            return(new MergeResolution
            {
                OperationType = operationType,
                Entity = EntityChange.Create(entityInfo, entity)
            });
        }