示例#1
0
        /// <summary>
        /// 取得文化資產
        /// </summary>
        /// <param name="lat">緯度</param>
        /// <param name="lng">經度</param>
        /// <param name="locationRadius">半徑範圍</param>
        /// <returns></returns>
        public static IList <CulturalHeritageEntity> Get(float lat, float lng, int locationRadius = 1)
        {
            IList <CulturalHeritageEntity> list = null;

            using (var openData = new CulturalHeritage())
            {
                var table = openData.GetByLatLng(lat, lng, locationRadius);

                list = table.ToList <CulturalHeritageEntity>();
            }

            return(list);
        }
示例#2
0
        /// <summary>
        /// 取得文化資產
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns></returns>
        public static CulturalHeritageEntity Get(string id)
        {
            CulturalHeritageEntity entity = null;

            using (var openData = new CulturalHeritage())
            {
                var table = openData.GetById(id);

                entity = table.ToList <CulturalHeritageEntity>().FirstOrDefault();
            }

            return(entity);
        }