MCPcopy Create free account
hub / github.com/TryCatchLearn/Overflow / VoteDbContext

Class VoteDbContext

VoteService/Data/VoteDbContext.cs:6–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace VoteService.Data;
5
6public class VoteDbContext(DbContextOptions options) : DbContext(options)
7{
8 public DbSet<Vote> Votes { get; set; }
9
10 protected override void OnModelCreating(ModelBuilder modelBuilder)
11 {
12 modelBuilder.Entity<Vote>(x =>
13 {
14 x.HasIndex(v => new { v.UserId, v.TargetType, v.TargetId }).IsUnique();
15 x.Property(v => v.VoteValue).HasDefaultValue(0);
16 });
17 }
18}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…