コード例 #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.FilesystemKey = entity.FilesystemKey;
            updateColumns.ProcessorId   = entity.ProcessorId;
            ServiceLock newEntity = broker.Insert(updateColumns);

            return(newEntity);
        }