using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL.Interfaces;
using Domain.Contacts;

namespace DAL.Repositories
{
    public class ContactRepository : EFRepository<Contact>, IContactRepository
    {
        public ContactRepository(IDbContext dbContext) : base(dbContext)
        {
        }

        public ICollection<Contact> AllForUser(string userId)
        {
            return DbSet.
                Where(a => a.Person.UserId == userId).
                Include(b => b.ContactType).
                Include(c => c.Person).
                ToList();
        }
    }
}
