예제 #1
0
        internal static SyncObject Prepare(ISiteObject SiteObject, string StoreName = null, bool IsDelete = false)
        {
            SyncObject syncobject = null;

            if (IsDelete)
            {
                syncobject                 = new SyncObject();
                syncobject.IsDelete        = true;
                syncobject.ObjectConstType = SiteObject.ConstType;
                syncobject.ObjectId        = SiteObject.Id;
            }
            else
            {
                syncobject = SyncObjectConvertor.ToSyncObject(SiteObject);
            }

            if (string.IsNullOrEmpty(StoreName))
            {
                StoreName = SiteObject.GetType().Name;
            }
            syncobject.StoreName = StoreName;

            if (SiteObject is ICoreObject)
            {
                var coreobject = SiteObject as ICoreObject;
                syncobject.SenderVersion = coreobject.Version;
            }

            return(syncobject);
        }
예제 #2
0
        internal static SyncObject Prepare(Guid Id, Dictionary <string, object> Data, string tableName, string colName, long version, bool IsDelete = false)
        {
            SyncObject syncobject = null;

            if (IsDelete)
            {
                syncobject           = new SyncObject();
                syncobject.IsDelete  = true;
                syncobject.TableName = tableName;
                syncobject.ObjectId  = Id;
            }
            else
            {
                syncobject = SyncObjectConvertor.ToTableSyncObject(tableName, Id, colName, Data);
            }

            syncobject.SenderVersion = version;

            return(syncobject);
        }