Exemplo n.º 1
0
    public ISetSource GetExpectedData()
    {
        if (_data == null)
        {
            using var context = CreateContext();
            _data             = new ManyToManyData(context, false);
            context.ChangeTracker.DetectChanges();
            context.ChangeTracker.Clear();
        }

        return(_data);
    }
Exemplo n.º 2
0
        public static void Seed(ManyToManyContext context)
        {
            var ones          = ManyToManyData.CreateOnes();
            var twos          = ManyToManyData.CreateTwos();
            var threes        = ManyToManyData.CreateThrees();
            var compositeKeys = ManyToManyData.CreateCompositeKeys();
            var roots         = ManyToManyData.CreateRoots();

            context.EntityOnes.AddRange(ones);
            context.EntityTwos.AddRange(twos);
            context.EntityThrees.AddRange(threes);
            context.EntityCompositeKeys.AddRange(compositeKeys);
            context.EntityRoots.AddRange(roots);

            ManyToManyData.WireUp(ones, twos, threes, compositeKeys, roots);

            context.SaveChanges();
        }
Exemplo n.º 3
0
 public static void Seed(ManyToManyContext context)
 => ManyToManyData.Seed(context);