Exemplo n.º 1
0
        /// <summary>
        /// 通道主机号搜索数据库
        /// </summary>

        public async Task <List <CameraDto> > GetListByDVRID(string DVRID)
        {
            var camera = _repository.AsQueryable().Where(u => u.DVR_ID == DVRID).ToList();

            //  var get = await _repository.GetListAsync();

            foreach (var item in camera)
            {
                if (item.Direction != null)
                {   //繁体转简体
                    item.Direction = ChineseConverter.Convert(item.Direction, ChineseConversionDirection.TraditionalToSimplified);
                }

                if (item.Location != null)
                {
                    item.Location = ChineseConverter.Convert(item.Location, ChineseConversionDirection.TraditionalToSimplified);
                }
            }


            var cameras = ObjectMapper.Map <List <Camera>, List <CameraDto> >(camera);

            return(cameras);
        }