Premise:
Two Tables - A and B - related with a one-to-many relationship.
The join table is not explicit... i.e. I didn't create it and it doesn't appear in the projects normal file folder structure / organization / hierarchy.
Question:
Where is, and how do I view / manipulate, the joining information / table?
Environment: Net Core 6 MVC, Visual Studio Community 2022 (64 bit), WIndows 11
A
namespace ViewModel.Models
{
public class A
{
public int Id { get; set; }
public string? One { get; set; }
public string? Two { get; set; }
public string? Three { get; set; }
// _______________________________________
public IEnumerable<B>? B { get; set; }
}
}
B
namespace ViewModel.Models
{
public class B
{
public int Id { get; set; }
public string? One { get; set; }
public string? Two { get; set; }
public string? Three { get; set; }
// _______________________________________
public int? AId { get; set; }
public A? A { get; set; }
}
}
Context
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ViewModel.Models;
namespace ViewModel.Data
{
public class ViewModelContext : DbContext
{
public ViewModelContext (DbContextOptions<ViewModelContext> options)
: base(options)
{
}
public DbSet<ViewModel.Models.A> A { get; set; } = default!;
public DbSet<ViewModel.Models.B>? B { get; set; }
}
}