I am loading 6 different models from SQL-Server-Management-Studio via EF Core Powertools into my web api project.
I got follwoing Models in my project.
I want to add a picture with the list of tags and categories like this.
var picture = new PressPicPicture
{
Image = bytes,
CreatedAt = request.CreatedAt,
CreatedBy = request.CreatedBy
};
await _pictureRepository.AddPicture(picture, cancellationToken);
foreach (var catId in request.CategoryIds)
{
var picutureCategory = new PressPicPictureCategories
{
IdPicture = picture.Id,
IdCat = catId
};
await picutureCategory.AddPictureTag(picutureCategory, cancellationToken);
}
My problem is that i cant access the PressPicPictureCategories Model because i dont get it into my project with EF-Core-Powertools 6. So my question is: Is there a way to solve this?
Solved it! Options/Advanced --> use many to many relations