| 4 | namespace VoteService.Data; |
| 5 | |
| 6 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…