/*--------------------------------------------------------------------------------------------*/
        private IWeaverPathPipeEnd MakePropertyKey <T>(string pElement, Expression <Func <T, object> > pProp,
                                                       IWeaverVarAlias pGroupVar = null) where T : IWeaverElement
        {
            WeaverPropPair wpp = WeaverUtil.GetPropertyAttribute(pProp);
            WeaverTitanPropertyAttribute att = WeaverTitanUtil.GetAndVerifyTitanPropertyAttribute(wpp);
            Type pt = wpp.Info.PropertyType;

            AddCustom("makeType()");
            AddCustom("dataType(" + WeaverTitanPropertyAttribute.GetTitanTypeName(pt) + ".class)");
            AddCustom("name(" + Path.Query.AddParam(new WeaverQueryVal(att.DbName)) + ")");
            AddCustom("unique(OUT)");             //WeaverConfig enforces unique property DbNames

            if (pGroupVar != null)
            {
                AddCustom("group(" + pGroupVar.Name + ")");
            }

            if (att.TitanIndex)
            {
                AddCustom("indexed(" + pElement + ".class)");
            }

            if (att.TitanElasticIndex)
            {
                AddCustom("indexed('search'," + pElement + ".class)");
            }

            return(AddCustom("makePropertyKey()"));
        }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public string GetTitanTypeName()
 {
     return(WeaverTitanPropertyAttribute.GetTitanTypeName(Type));
 }
Exemple #3
0
 public void GetTitanTypeNameStatic(Type pType, string pExpect)
 {
     Assert.AreEqual(pExpect, WeaverTitanPropertyAttribute.GetTitanTypeName(pType), "Incorrect result.");
 }