26 lines
796 B
C#
26 lines
796 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using PARR.AIHITRelationshipsSyncer.Models;
|
|
|
|
namespace PARR.AIHITRelationshipsSyncer.Context
|
|
{
|
|
internal class AIHITContext : DbContext
|
|
{
|
|
public AIHITContext(DbContextOptions<AIHITContext> options) : base(options) { }
|
|
|
|
|
|
public DbSet<AihitData> AihitDatas { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
//Делаем это чтобы EF не пытался трекать объкты полученые из хранимой процедуры
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
modelBuilder.Entity<AihitData>(entity =>
|
|
{
|
|
entity.HasNoKey();
|
|
entity.ToView(null);
|
|
});
|
|
}
|
|
}
|
|
}
|