Shyamal Parikh Shyamal Parikh - 1 year ago 109
C# Question

EF6: Full-text Search with Database First Approach

I found this link to make

full-text search
work through
. However, the code seems to be targeting
database first approach
. How to make it work with
Database First Approach

Relevant part of code:

public class NoteMap : EntityTypeConfiguration<Note>
public NoteMap()
// Primary Key
HasKey(t => t.Id);
public class MyContext : DbContext
static MyContext()
DbInterception.Add(new FtsInterceptor());
public MyContext(string nameOrConnectionString) : base(nameOrConnectionString)
public DbSet<Note> Notes { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
modelBuilder.Configurations.Add(new NoteMap());

As seen above the function
is only called in
Code First Approach
. I wonder what needs to change to make the code in link work for
Database First

Answer Source

Ok, I tried implementing the solution without OnModelCreating altogether and it turns out that it is not even needed for FullText interceptor implementation as @Evk suggested.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download