Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace InteractiveMap.Repositories
- {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using InteractiveMap.Data;
- using InteractiveMap.Data.Entities;
- using InteractiveMap.Repositories.Contracts;
- using Microsoft.EntityFrameworkCore;
- /// <summary>
- /// Repository responsible for dealing with Employee entities.
- /// </summary>
- public class EmployeeRepository : GenericRepository<Employee>, IEmployeeRepository, IRepository<Employee>
- {
- /// <summary>
- /// Field containing project's database context
- /// </summary>
- private readonly InteractiveMapDbContext context;
- /// <summary>
- /// Initializes a new instance of the <see cref="EmployeeRepository"/> class.
- /// </summary>
- /// <param name="context">Project database context</param>
- public EmployeeRepository(InteractiveMapDbContext context)
- : base(context)
- {
- this.context = context;
- }
- /// <inheritdoc/>
- public Task<Employee> GetEmployeeByWorkPlaceNumberAsync(int workplaceNumber)
- {
- throw new NotImplementedException();
- }
- /// <inheritdoc/>
- public async Task<ICollection<Employee>> GetEmployeesByInterestAsync(int interestId)
- {
- var result = await this.context.InterestsEmployees
- .Where(i => i.InterestId == interestId)
- .Select(e => e.Employee).ToListAsync();
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement