어떻게하면 다음과 같은 linq를 sql에서 람다 식으로 변환 할 수 있습니까? 감사.Linq 쿼리를 람다로 변환
var existing = (from a in db.sms_imported_trn_code
where !db.sms_description.Any(m => m.trn_code == a.trn_code)
select new { trn_code = a.trn_code }).ToList();
편집 : 나는 다음과 같은 쿼리를 시도하지만 나에게 오류를 제공
. 아래 이미지를보십시오.
내 모델 클래스는 "s.sms_description"를 작성하기 때문에 오류를 얻고있다
public class sms_imported_trn_code
{
public int id { get; set; }
public string trn_code { get; set; }
List<sms_imported_trn_code> sms_import_list { get; set; }
}
}
public class sms_description
{
public int id { get; set; }
public string trn_code { get; set; }
public string Description { get; set; }
[DisplayFormat(DataFormatString = "{0:MMM-dd-yyyy}", ApplyFormatInEditMode = true)]
public DateTime create_date { get; set; }
public string created_by { get; set; }
}
왜 이렇게해야합니까? – sr28
그리고 묻기 전에 무엇을 시도 했습니까? 도움이 될 것입니다. https://codeblog.jonskeet.uk/2011/01/28/reimplementing-linq-to-objects-part-41-how-query-expressions-work/ –
[ask]를 읽고 연구 내용을 공유하십시오. 실제 오류쪽으로. 오류가 없으면 우리는 많이 할 수 없습니다. – CodeCaster