문제

When I execute the code:

        public List<T> GetCustomerTxList(int customerId)
        {
            var matchingPocos = new List<T>();

            using (linq.AOMSEntities dataRepos = new linq.AOMSEntities())
            {        
                IEnumerable txlist = from t in dataRepos.TransactionRecord
                                 where t.CustomerReference.Value.Id == customerId
                                 select t;

                foreach (EntityObject entity in txlist)
                {
                    matchingPocos.Add(entity.ConvertToPoco<T>());
                }
            }
            return matchingPocos;
        }

I get the following exception: Data.Repository.Integration.Test.LinqRepositoryTest.GetCustomerTxList: System.NotSupportedException : The specified type member 'CustomerReference' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.

CustomerReference is an EntityReference on the TransactionRecord entity referencing a Customer entity.

Why can I not query using an entity reference?

What is the recommended approach to perform such a query?

I'll gladly provide more info/code if it helps.

도움이 되었습니까?

해결책

확인

REST / JSON 바이러스 백신 웹 서비스 지원

여기 게시물 - https://stackoverflow.com/questions/4104985/antivirus-scanning-service

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top