C# Класс EFRepositoryPattern.Tests.Repositories.AlternatePostRepository

Наследование: PostRepository
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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