internal static void AddTxSummary(AccountTxSummary s) { var context = new AccountTxSummaryDataContext(); context.AccountTxSummaries.InsertOnSubmit(entity: s); context.SubmitChanges(); }
internal static void DeleteTxSummaryForUser(string account, long chatId) { var context = new AccountTxSummaryDataContext(); var summaries = GetTxSummary(account: account, days: 1000, chatId: chatId); foreach (var sum in summaries) { context.AccountTxSummaries.Attach(entity: sum); context.AccountTxSummaries.DeleteOnSubmit(entity: sum); } context.SubmitChanges(); }