using System.Linq;
using EspaceClient.FrontOffice.Business.Depots;
using EspaceClient.FrontOffice.Domaine;

namespace EspaceClient.FrontOffice.Data.Depots
{
    public partial class DepotTypeRenduBloc : Depot<TypeRenduBloc>, IDepotTypeRenduBloc
    {
        public TypeRenduBloc GetByCode(string code, string codeTypeBloc)
        {
            var query = from trb in DbContext.TypeRenduBlocs
                        where trb.Code == code
                        where trb.TypeBloc.Code == codeTypeBloc
                        select trb;

            return query.FirstOrDefault();
        }
    }
}
