아래의 코드 오류 발생 :LINQ는 사용자 정의 방법
LINQ to Entities does not recognize the method
System.String GenerateSubscriptionButton(Int32)
method, and this method cannot be translated into a store expression.
가 어떻게 엔티티에 LINQ에서 올바른 사용자 정의 메소드를 만들려면 어떻게해야합니까를?
var model = _serviceRepository.GetProducts().Select(p => new ProductModel
{
Id = p.Id,
Name = p.Name,
Credits = p.Credits,
Months = p.Months,
Price = p.Price,
PayPalButton = GenerateSubscriptionButton(p.Id)
});
private string GenerateSubscriptionButton(int id)
{
return new PaymentProcessor.PayPalProcessor().CreateSubscriptionButton(id);
}
감사합니다.이 답변은 내 하루를 만들었습니다. :) – NMathur