C# 클래스 EFRepositoryPattern.Tests.Repositories.AlternatePostRepository

상속: PostRepository
파일 보기 프로젝트 열기: hartez/EFRepositoryPattern 1 사용 예제들

공개 메소드들

메소드 설명
AlternatePostRepository ( BlogContext context ) : System.Collections.Generic
Retrieve ( PostCriteria criteria = null ) : IEnumerable

Override of Retrieve that builds an explicit SQL query to do the work instead of have EF do it

This is an example to demonstrate replacing an EF-based method with a custom method. Because the Order class and the custom criteria class provide enough information, EF's generated query can be completely replaced with something else. Here it's a SQL statement that we cobble together; it could just as easily be a stored procedure or a query against a NoSQL store of some kind. You're not locked into EF or SQL Server in any way.

메소드 상세

AlternatePostRepository() 공개 메소드

public AlternatePostRepository ( BlogContext context ) : System.Collections.Generic
context EFRepositoryPattern.Tests.Models.BlogContext
리턴 System.Collections.Generic

Retrieve() 공개 메소드

Override of Retrieve that builds an explicit SQL query to do the work instead of have EF do it
This is an example to demonstrate replacing an EF-based method with a custom method. Because the Order class and the custom criteria class provide enough information, EF's generated query can be completely replaced with something else. Here it's a SQL statement that we cobble together; it could just as easily be a stored procedure or a query against a NoSQL store of some kind. You're not locked into EF or SQL Server in any way.
public Retrieve ( PostCriteria criteria = null ) : IEnumerable
criteria PostCriteria The post criteria
리턴 IEnumerable