Example #1
0
        public void DeletePostSetting(User user, PostSetting postSetting)
        {
            User        currentUser        = _context.Users.FirstOrDefault(u => u.Name == user.Name);
            PostSetting currentPostSetting = currentUser.PostSettings.FirstOrDefault(p => p.PostSettingId == postSetting.PostSettingId);

            currentUser.PostSettings.Remove(currentPostSetting);
        }
Example #2
0
        public void EditPostSetting(User user, PostSetting postSetting)
        {
            User        currentUser        = _context.Users.FirstOrDefault(u => u.Name == user.Name);
            PostSetting currentPostSetting = currentUser.PostSettings.FirstOrDefault(p => p.PostSettingId == postSetting.PostSettingId);

            currentPostSetting.UpdateModel(postSetting);
        }