Example #1
0
        /// <summary>
        /// 获取所有数据
        /// </summary>
        public async Task <ListResultOutput <MapDto> > GetAllList()
        {
            try
            {
                //var query = await _IMapRepository.GetAllListAsync();
                var query = _IMapRepository.GetAllList();
                var list  = new ListResultOutput <MapDto>(query.MapTo <List <MapDto> >());
                if (list.Items.Count > 0)
                {
                    for (int i = 0; i < list.Items.Count; i++)
                    {
                        if (list.Items[i].MapScale != null)
                        {
                            list.Items[i].MapScaleName = GetDetailCodeName(list.Items[i].MapScale);
                        }
                        if (list.Items[i].SpatialRefence != null)
                        {
                            list.Items[i].SpatialRefenceName = GetDetailCodeName(list.Items[i].SpatialRefence);
                        }
                        if (list.Items[i].MapType != null)
                        {
                            try
                            {
                                var mapType = _IDataTypeRepository.Get(list.Items[i].MapType);
                                list.Items[i].MapType = mapType.TypeName;
                            }
                            catch (Exception ex)
                            {
                                list.Items[i].MapType = "";
                            }
                        }
                        list.Items[i].MapTag = GetMultiTagNameByMapID(list.Items[i].Id);
                    }
                }

                return(list);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }