TanvirArjel / EFCore.GenericRepository

This repository contains Generic Repository implementation for Entity Framework Core
MIT License
600 stars 89 forks source link

Composite key support #12

Closed AntonPaskrobka closed 3 years ago

AntonPaskrobka commented 3 years ago

I have a composite key in my database. How do I use the GetByIdAsync method?

TanvirArjel commented 3 years ago

@AntonPaskrobka You can get as follows:

var item =  _repository.GetAsync<YourEntity>(e => e.FirstKey == keyValue1 && e.SecondKey == keyValue2);
AntonPaskrobka commented 3 years ago

It works great. Thanks