< Summary

Information
Class: cat_cafe.Repositories.CatCafeContext
Assembly: cat_cafe
File(s): C:\Users\draia\Documents\Dev\N3_CSHARP\cat_cafe\cat_cafe\Repositories\CatCafeContext.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 25
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%11100%
OnModelCreating(...)100%11100%

File(s)

C:\Users\draia\Documents\Dev\N3_CSHARP\cat_cafe\cat_cafe\Repositories\CatCafeContext.cs

#LineLine coverage
 1using cat_cafe.Entities;
 2using Microsoft.EntityFrameworkCore;
 3
 4namespace cat_cafe.Repositories
 5{
 6    public class CatCafeContext : DbContext
 7    {
 8        public CatCafeContext(DbContextOptions<CatCafeContext> options)
 159            : base(options)
 1510        {
 1511        }
 12
 4613        public DbSet<Cat> Cats { get; set; } = null!;
 4414        public DbSet<Bar> Bars { get; set; } = null!;
 4415        public DbSet<Customer> Customers { get; set; } = null!;
 16
 17        protected override void OnModelCreating(ModelBuilder modelBuilder)
 218        {
 219            modelBuilder.Entity<Cat>()
 220                .HasOne(c => c.Bar)
 221                .WithMany(b => b.Cats)
 222                .HasForeignKey(c => c.BarId);
 223        }
 24    }
 25}