using System.Linq;
using Rainbow.Models;

namespace Rainbow.Data
{
    public class CustomersRepository : GenericRepository<Customer>, ICustomersRepository
    {
        public CustomersRepository(RainbowContext context) : base(context)
        {
        }

        public Customer GetByNumber(string number)
        {
            return Context.Customers.SingleOrDefault(c => c.Number == number);
        }

        public Customer GetByCompanyName(string name)
        {
            return Context.Customers.SingleOrDefault(c => c.CompanyName == name);
        }
    }
}
