Ejemplo n.º 1
0
 internal static bool IsHashingRelevant(this PropertyInfo property, DataCategory?dataCategory)
 {
     if (property.PropertyType.IsSubclassOf(typeof(BO4E.COM.COM)) || property.PropertyType.IsSubclassOf(typeof(BO4E.BO.BusinessObject)))
     {
         return(true);
     }
     else if (property.PropertyType.IsGenericType && property.PropertyType.GetGenericTypeDefinition() == typeof(List <>))
     {
         var listElementType = property.PropertyType.GetGenericArguments()[0];
         return(listElementType.IsSubclassOf(typeof(BO4E.COM.COM)) || listElementType.IsSubclassOf(typeof(BO4E.BO.BusinessObject)));
     }
     else if (dataCategory.HasValue)
     {
         foreach (Attribute attribute in property.GetCustomAttributes().Where(a => a.GetType() == typeof(DataCategoryAttribute)))
         {
             DataCategoryAttribute dataCatagoryAttribute = (DataCategoryAttribute)attribute;
             if (!dataCatagoryAttribute.Mapping.Contains(dataCategory.Value))
             {
                 continue;
             }
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
 internal static bool IsDeletionRelevant(this PropertyInfo property, DataCategory?dataCategory)
 {
     if (property.PropertyType.IsEnum)
     {
         return(false);
     }
     if (dataCategory.HasValue)
     {
         foreach (Attribute attribute in property.GetCustomAttributes().Where(a => a.GetType() == typeof(DataCategoryAttribute)))
         {
             DataCategoryAttribute dataCatagoryAttribute = (DataCategoryAttribute)attribute;
             if (!dataCatagoryAttribute.Mapping.Contains(dataCategory.Value))
             {
                 continue;
             }
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
 internal static bool IsEncryptionRelevant(this PropertyInfo property, DataCategory?dataCategory)
 {
     if (property.PropertyType.IsSubclassOf(typeof(BO4E.COM.COM)) || property.PropertyType.IsSubclassOf(typeof(BO4E.BO.BusinessObject)) || property.PropertyType.IsEnum)
     {
         return(false); // not yet supported for encryption
     }
     if (dataCategory.HasValue)
     {
         foreach (Attribute attribute in property.GetCustomAttributes().Where(a => a.GetType() == typeof(DataCategoryAttribute)))
         {
             DataCategoryAttribute dataCatagoryAttribute = (DataCategoryAttribute)attribute;
             if (!dataCatagoryAttribute.Mapping.Contains(dataCategory.Value))
             {
                 continue;
             }
             return(true);
         }
     }
     return(false);
 }