public virtual void DeleteSetting <T>() where T : ISettings, new() { var settingsToDelete = new List <TblSettings>(); var allSettings = GetAsEnumerable(); foreach (var prop in typeof(T).GetProperties()) { string key = typeof(T).Name + "." + prop.Name; _localizedEntityService.DeleteEntityAllLocalizedStrings(0, typeof(T).Name, prop.Name); settingsToDelete.AddRange(allSettings.Where(x => x.Name.Equals(key, StringComparison.InvariantCultureIgnoreCase))); } Delete(settingsToDelete); }