using Housewives.Api.Data; using Housewives.Api.Entities; using Housewives.Api.Repositories.Contracts; using Microsoft.EntityFrameworkCore; namespace Housewives.Api.Repositories { public class HousewifeRepository : IHousewifeRepository { private readonly HousewivesDbContext housewivesDbContext; public HousewifeRepository(HousewivesDbContext housewivesDbContext) { this.housewivesDbContext = housewivesDbContext; } public Task GetHousewife(int id) { throw new NotImplementedException(); } public async Task> GetHousewives() { var housewives = await this.housewivesDbContext.Housewives.ToListAsync(); return housewives; } public Task GetQuote(int id) { throw new NotImplementedException(); } public async Task> GetQuotes() { var quotes = await this.housewivesDbContext.Quotes.ToListAsync(); return quotes; } public async Task> GetQuotesById(int housewifeId) { var quotes = await (from quote in housewivesDbContext.Quotes where quote.HousewifeId == housewifeId select quote).ToListAsync(); return quotes; } } }