public FieldDto Get(EntityDto <int> input) { var query = _fieldRepository.GetAllIncluding(f => f.Device).Where(f => f.Id == input.Id); var entity = query.FirstOrDefault(); if (entity.IsNullOrDeleted()) { throw new ApplicationException("该field不存在或已被删除"); } return(ObjectMapper.Map <FieldDto>(entity)); }