Ejemplo n.º 1
0
        public void RemoveUserSettingsRecord(UserSettingsModel model)
        {
            model.NullInspect(nameof(model));

            using (var db = new GmailBotDbContext())
            {
                var existModel = db.UserSettings
                                 .Where(userSettings => userSettings.Id == model.Id)
                                 .Include(userSettings => userSettings.IgnoreList)
                                 .Include(userSettings => userSettings.Blacklist)
                                 .Include(userSettings => userSettings.Whitelist)
                                 .SingleOrDefault();
                if (existModel == null)
                {
                    return;
                }

                db.UserSettings.Remove(existModel);
                db.SaveChanges();
            }
        }
Ejemplo n.º 2
0
 public AdditionalMenuKeyboard(UserSettingsModel settings)
 {
     settings.NullInspect(nameof(settings));
     Settings = settings;
 }