예제 #1
0
        public IEnumerable <PropertyFeatureDetailDTO> SelectByProperty(Guid propertyId)
        {
            PropertyFeatureRepository featureRepository = new PropertyFeatureRepository(Connector);

            return(Connector.ExecuteReader(selectByPropertyQuery, new Dictionary <string, object>()
            {
                { "Property", propertyId }
            }, reader => ReadFromDataReader(reader, featureRepository)));
        }
예제 #2
0
        private PropertyFeatureDetailDTO ReadFromDataReader(IDataReader reader, PropertyFeatureRepository featureRepository)
        {
            byte featureId = (byte)reader["Feature"];

            return(new PropertyFeatureDetailDTO()
            {
                Property = new PropertyDTO()
                {
                    Id = (Guid)reader["Property"]
                },
                Feature = new PropertyFeatureDTO()
                {
                    Id = featureId,
                    DisplayName = new LocalizationDictionary(featureRepository.GetDisplayName(featureId))
                },
                Value = reader["Value"] as string
            });
        }