ここに私の GroupNews モデルがあります:
class GroupEvent
{
[Key]
public int GroupEvenID { get; set; }
public int GroupID { get; set; }
[ForeignKey("GroupID")]
public virtual Group RelatedGroups { get; set; }
public int EvenID { get; set; }
[ForeignKey("EventID")]
public virtual Event RelatedEvent { get; set; }
}
およびリポジトリ:
public class GroupEventRepositoryDB : RepositoryBase<GroupEvent>, IGroupEventRepository
{
/// <summary>
/// Initializes a new instance of the <see cref="GroupEventRepositoryDB"/> class.
/// </summary>
/// <param name="databaseFactory">The database factory.</param>
public GroupEventRepositoryDB(IDatabaseFactory databaseFactory)
: base(databaseFactory)
{
}
}
/// <summary>
/// GroupEvent repository interface.
/// </summary>
public interface IGroupEventRepository : IRepository<GroupEvent>
{
}
ただし、保護レベルが原因で GroupEvent にアクセスできません。