示例#1
0
        protected virtual object EncryptArrayValue(IDataAccessor dataAccessor, string nameValue, object value, DataAccessorOptionEnum options)
        {
            if (!options.HasFlag(DataAccessorOptionEnum.Encrypted) || dataAccessor == null || value == null) return value; // rien à faire
            if (this.OptionForEncrypt == null) throw new NullReferenceException($"DataAccessorEncrypt OptionForEncrypt NULL (objectType: {dataAccessor.GetType().Name})");
            string[] adata = DataAccessorTools.ConvertoArrayString(value);
            for (int i = 0; i < adata.Length; i++) // on encrypte les valeurs une par une
                adata[i] = Nglib.FORMAT.CryptHashTools.Encrypt(adata[i], this.OptionForEncrypt);

            return adata;
        }
示例#2
0
        public static TEnum GetEnum <TEnum>(this IDataAccessor dataAccessor, string fieldname, DataAccessorOptionEnum AccesOptions = 0) where TEnum : struct
        {
            TEnum defaultValue = DataAccessorTools.GetEnumDefaultValue <TEnum>();

            return(GetEnum <TEnum>(dataAccessor, fieldname, defaultValue, AccesOptions).Value);
        }