//count entities so we can fill the adult/child/whatever we need count

        public static int CountEntitiesForProperty(Property aProperty, PropertyEntityType aType)
        {
            PortugalVillasContext _db = new PortugalVillasContext();

            int count = 0;
                
            count =  _db.PropertyEntities
                        .Where(x => x.PropertyEntityTypeID == aType.PropertyEntityTypeID)
                        .Where(x => x.PropertyID == aProperty.PropertyID)
                        .Select(x => x.PropertyEntityID).Count();

            return count;
        }
Example #2
0
        //count entities so we can fill the adult/child/whatever we need count

        public static int CountEntitiesForProperty(Property aProperty, PropertyEntityType aType)
        {
            PortugalVillasContext _db = new PortugalVillasContext();

            int count = 0;

            count = _db.PropertyEntities
                    .Where(x => x.PropertyEntityTypeID == aType.PropertyEntityTypeID)
                    .Where(x => x.PropertyID == aProperty.PropertyID)
                    .Select(x => x.PropertyEntityID).Count();

            return(count);
        }