当前位置: 首页>>代码示例>>C#>>正文


C# SqlDatabase.Update方法代码示例

本文整理汇总了C#中SqlDatabase.Update方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDatabase.Update方法的具体用法?C# SqlDatabase.Update怎么用?C# SqlDatabase.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SqlDatabase的用法示例。


在下文中一共展示了SqlDatabase.Update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

 private static void Update(BubbleGroupSettings settings)
 {
     lock (_lock)
     {
         using (var db = new SqlDatabase<BubbleGroupSettings>(GetPath()))
         {
             db.Update(settings);
         }
     }
 }
开发者ID:StefanTischler,项目名称:DisaOpenSource,代码行数:10,代码来源:BubbleGroupSettingsManager.cs

示例2: Set

 public static void Set(TelegramDc dc)
 {
     lock (_lock)
     {
         using (var db = new SqlDatabase<TelegramDc>(Location))
         {
             foreach (var entry in db.Store.Where(x => x.Dc == dc.Dc))
             {
                 entry.Key = dc.Key;
                 entry.Salt = dc.Salt;
                 db.Update(entry);
                 return;
             }
                 
             db.Add(dc);
         }
     }
 }
开发者ID:akonsand,项目名称:DisaOpenSource,代码行数:18,代码来源:TelegramDcManager.cs

示例3: SetNeedsContactSync

 internal static void SetNeedsContactSync(Service[] services, bool value)
 {
     if (services == null)
         return;
     lock (_lock)
     {
         using (var db = new SqlDatabase<Entry>(Location))
         {
             foreach (var service in services)
             {
                 if (service == null)
                     continue;
                 bool updated = false;
                 foreach (var entry in db.Store.Where(x => x.ServiceName == 
                     service.Information.ServiceName))
                 {
                     Utils.DebugPrint("NeedsContactSync for service " 
                         + service.Information.ServiceName + " is being updated to " + value);
                     entry.NeedsContactSync = value;
                     db.Update(entry);
                     updated = true;
                     break;
                 }
                 if (!updated)
                 {
                     Utils.DebugPrint("NeedsContactSync for service " 
                         + service.Information.ServiceName + " is being set to " + value);
                     db.Add(new Entry
                     {
                         ServiceName = service.Information.ServiceName,
                         NeedsContactSync = value,
                     });
                 }
             }
         }
     }
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:37,代码来源:SettingsChangedManager.cs

示例4: UpdateLastBubbleOrAndLastModifiedIndex

 public static void UpdateLastBubbleOrAndLastModifiedIndex(string bubbleGroupId, VisualBubble lastBubble = null, long lastModifiedIndex = -1)
 {
     lock (_dbLock)
     {
         if (lastBubble == null && lastModifiedIndex == -1)
             return;
     
         using (var db = new SqlDatabase<Entry>(Location, false))
         {
             if (!db.Failed)
             {
                 foreach (var item in db.Store.Where(x => !x.Unified && x.Guid == bubbleGroupId))
                 {
                     if (lastBubble != null)
                     {
                         item.LastBubble = SerializeBubble(lastBubble);
                         item.LastBubbleGuid = lastBubble.ID;
                     }
                     if (lastModifiedIndex != -1)
                     {
                         item.LastModifiedIndex = lastModifiedIndex;
                     }
                     db.Update(item);
                 }
             }
         }
     }
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:28,代码来源:BubbleGroupIndex.cs

示例5: SetUnifiedSendingBubbleGroup

 internal static void SetUnifiedSendingBubbleGroup(string unifiedGroupId, string sendingGroupId)
 {
     lock (_dbLock)
     {
         using (var db = new SqlDatabase<Entry>(Location, false))
         {
             if (!db.Failed)
             {
                 foreach (var item in db.Store.Where(x => x.Unified && x.Guid == unifiedGroupId))
                 {
                     item.UnifiedSendingBubbleGroupGuid = sendingGroupId;
                     db.Update(item);
                 }
             }
         }
     }
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:17,代码来源:BubbleGroupIndex.cs


注:本文中的SqlDatabase.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。