예제 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public static string BuildPropList <T>(IWeaverConfig pConfig, IWeaverQuery pQuery, T pElem,
                                               bool pIncludeId = false) where T : IWeaverElement
        {
            IList <WeaverPropPair> props = GetElementPropertyAttributes(typeof(T));
            var sb = new StringBuilder();

            foreach (WeaverPropPair wpp in props)
            {
                string dbName = wpp.Attrib.DbName;

                if (!pIncludeId && dbName == "id")
                {
                    continue;
                }

                object val = wpp.Info.GetValue(pElem, null);

                if (val != null)
                {
                    sb.Append((sb.Length > 0 ? "," : "") +
                              dbName + ":" + pQuery.AddParam(new WeaverQueryVal(val)));
                }
            }

            return(sb.ToString());
        }
예제 #2
0
 /*--------------------------------------------------------------------------------------------*/
 public string AddParam(object pObject)
 {
     return(vQuery.AddParam(new WeaverQueryVal(pObject)));
 }