public ArticlesContext(DatabaseContextOptions options)
     : base(options)
 {
     Articles = Collection <Article>("articles", (fb, article) => fb.Where(e => e.Id == article.Id))
                .HasIndex(
         idx => idx.Combine(
             idx.Text(e => e.Title),
             idx.Text(e => e.Body)
             ),
         (build, index) =>
     {
         index.Weights = build.Weights()
                         .Assign(e => e.Title, 5);
     }
         )
                .HasIndex(idx => idx.Ascending(e => e.CreatedAt))
                .ToDbCollection();
 }
 public DatabaseContext(
     IOptions <DatabaseContextOptions> options)
 {
     _options = options.Value;
 }
Exemple #3
0
 protected override ArticlesContext CreateContext(DatabaseContextOptions options)
 {
     return(new ArticlesContext(options));
 }
Exemple #4
0
 public MyContext(DatabaseContextOptions options) : base(options)
 {
 }
 public ConstraintTranslator(DatabaseContextOptions options)
 {
     options_ = options;
 }