Creating and Implementing the Repository
Now that we have defined the domain model classes, we can move on to the repository. I have added the folder Models/Domain/Repository
in which I created a new interface, IRepository
, shown in Listing 31-6.
Listing 31-6. The IRepository interface
using System.Collections.Generic;
namespace TriathlonApp.Models.Domain.Repository {
public interface IRepository {
IEnumerable<Event> Events { get; }
void SaveEvent(Event ev);
IEnumerable<EventType> EventTypes { get; }
IEnumerable<ReferenceTime> ReferenceTimes { get; }
IEnumerable<Athlete> Athletes { get; }
RankingSet GetPersonalRank(Event ev);
RankingSet GetReferenceRank(Event ev);
}
}
I have ...
Get Applied ASP.NET 4 in Context now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.