예제 #1
0
        static public ServiceLock Load(IPersistenceContext read, ServerEntityKey key)
        {
            var         broker    = read.GetBroker <IServiceLockEntityBroker>();
            ServiceLock theObject = broker.Load(key);

            return(theObject);
        }
예제 #2
0
 static public ServiceLock Insert(ServiceLock entity)
 {
     using (var update = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush))
     {
         ServiceLock newEntity = Insert(update, entity);
         update.Commit();
         return(newEntity);
     }
 }
예제 #3
0
        static public ServiceLock Insert(IUpdateContext update, ServiceLock entity)
        {
            var broker        = update.GetBroker <IServiceLockEntityBroker>();
            var updateColumns = new ServiceLockUpdateColumns();

            updateColumns.ServiceLockTypeEnum = entity.ServiceLockTypeEnum;
            updateColumns.Lock               = entity.Lock;
            updateColumns.ScheduledTime      = entity.ScheduledTime;
            updateColumns.Enabled            = entity.Enabled;
            updateColumns.State              = entity.State;
            updateColumns.ServerPartitionKey = entity.ServerPartitionKey;
            updateColumns.FilesystemKey      = entity.FilesystemKey;
            updateColumns.ProcessorId        = entity.ProcessorId;
            ServiceLock newEntity = broker.Insert(updateColumns);

            return(newEntity);
        }