/// <summary>
 /// Fills the kv extensible.
 /// </summary>
 /// <param name="baseObj">The base object.</param>
 /// <param name="sqlDataReader">The SQL data reader.</param>
 protected static void FillKVExtensible(IKVMetaExtensible baseObj, SqlDataReader sqlDataReader)
 {
     if (baseObj != null && sqlDataReader != null)
     {
         baseObj.KVMeta = sqlDataReader[column_KVMeta].ObjectToJsonObject <KVMetaDictionary>();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Merges to.
        /// </summary>
        /// <param name="kvMeta">The kv meta.</param>
        public void MergeTo(IKVMetaExtensible kvMeta)
        {
            if (kvMeta != null)
            {
                if (kvMeta.KVMeta == null)
                {
                    kvMeta.KVMeta = new KVMetaDictionary();
                }

                switch (UpdateStrategy)
                {
                case KVMetaUpdateStrategy.Clear:
                    kvMeta.KVMeta.Clear();
                    break;

                case KVMetaUpdateStrategy.Default:
                case KVMetaUpdateStrategy.Overwrite:
                    kvMeta.KVMeta = KVMeta ?? new KVMetaDictionary();
                    break;

                case KVMetaUpdateStrategy.MergeAll:
                    if (KVMeta.HasItem())
                    {
                        kvMeta.KVMeta.Merge(KVMeta, true);
                    }
                    break;

                case KVMetaUpdateStrategy.MergeNew:
                    if (KVMeta.HasItem())
                    {
                        kvMeta.KVMeta.Merge(KVMeta, false);
                    }
                    break;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Computes the specified k.
 /// </summary>
 /// <param name="kvMetaObject">The kv meta object.</param>
 /// <param name="k">The k.</param>
 /// <param name="operator">The operator.</param>
 /// <param name="v">The v.</param>
 /// <returns></returns>
 public static bool Compute(this IKVMetaExtensible kvMetaObject, string k, string @operator, JValue v)
 {
     return(Compute(kvMetaObject?.KVMeta, k, @operator, v));
 }