コード例 #1
0
        public static bool IsForSale(this RealEstateItem realEstateItem)
        {
            bool result = false;

            if ((realEstateItem.GetValue <TrackedList <Guid> >("Category")).Contains(RealEstateModule.ForSaleItemTypeTaxonId))
            {
                result = true;
            }

            return(result);
        }
コード例 #2
0
        public static T GetTaxon <T>(this RealEstateItem realEstateItem, TaxonType taxonType) where T : Taxon
        {
            var ids = (TrackedList <Guid>)realEstateItem.GetValue(taxonType.ToString());

            if (ids != null && ids.Count > 0)
            {
                return(taxonomyManager.GetTaxon <T>(ids[0]));
            }

            return(null);
        }
コード例 #3
0
        public static List <T> GetTaxons <T>(this RealEstateItem realEstateItem, TaxonType taxonType) where T : Taxon
        {
            List <T> result = new List <T>();
            var      ids    = (TrackedList <Guid>)realEstateItem.GetValue(taxonType.ToString());

            foreach (var id in ids)
            {
                result.Add(taxonomyManager.GetTaxon <T>(id));
            }

            return(result);
        }