Exemple #1
0
        public static IList <string> GetUpdatePropertiesName <T>()
        {
            IList <string> result = new List <string>();
            IDictionary <string, string> mapNames = MapNameAttribute.GetOriginalNamesMapNames <T>();

            foreach (PropertyInfo property in ReflectionUtils.GetPropertiesInfoWithoutAttribute <IgnoreInUpdateAttribute, T>())
            {
                result.Add(mapNames.ContainsKey(property.Name) ? mapNames[property.Name] : property.Name);
            }
            return(result);
        }
Exemple #2
0
        public static IList <IGenericPair <string, object> > GetUpdatePropertiesNameValue <T>(T entity)
        {
            IList <IGenericPair <string, object> > result   = new List <IGenericPair <string, object> >();
            IDictionary <string, string>           mapNames = MapNameAttribute.GetOriginalNamesMapNames <T>();

            foreach (PropertyInfo property in ReflectionUtils.GetPropertiesInfoWithoutAttribute <IgnoreInUpdateAttribute, T>())
            {
                result.Add(new GenericPair <string, object>(mapNames.ContainsKey(property.Name) ? mapNames[property.Name] : property.Name, property.GetValue(entity)));
            }
            return(result);
        }