コード例 #1
0
        internal static void AddHBSummary(AccountHarvestedSummary s)
        {
            var context = new AccountHarvestedSummaryDataContext();

            context.AccountHarvestedSummaries.InsertOnSubmit(entity: s);

            context.SubmitChanges();
        }
コード例 #2
0
        internal static void DeleteHbSummaryForUser(string account, long chatId)
        {
            var context = new AccountHarvestedSummaryDataContext();

            var summaries = GetHBSummary(account: account, days: 1000, chatId: chatId);

            foreach (var sum in summaries)
            {
                context.AccountHarvestedSummaries.Attach(entity: sum);
                context.AccountHarvestedSummaries.DeleteOnSubmit(entity: sum);
            }

            context.SubmitChanges();
        }