Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Коллекция пар: кастомное имя - параметр.
- // Используется для определения синонимов при проверке дубликатов зарезервированных имен колонок.
- private List<KeyValuePair<string, string>> FieldsSynonimus = new List<KeyValuePair<string,string>>
- {
- new KeyValuePair<string, string>("ShippingType", "Shipping"),
- new KeyValuePair<string, string>("BrandName", "Brand"),
- new KeyValuePair<string, string>("OurPrice", "Our Price"),
- };
- private bool IsDuplicatesReserved(string customName, string paramName)
- {
- if (string.IsNullOrEmpty(customName) || string.IsNullOrEmpty(paramName))
- return false;
- return !customName.Equals(paramName, StringComparison.OrdinalIgnoreCase) && // кастомное имя отличается от имени параметра
- ReservedNames.Contains(customName, StringComparer.OrdinalIgnoreCase) && // кастомное имя содержится в списке зарезервированных имен
- !NotLoadedFields.Contains(paramName, StringComparer.OrdinalIgnoreCase) && // этот параметр не содержится в списке незагружаемых полей
- !IsSynonimus(customName, paramName); // кастомное имя не является синонимом параметра
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement