本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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,
});
}
}
}
}
}
示例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);
}
}
}
}
}
示例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);
}
}
}
}
}