public PersonController(SampleODataDbContext sampleODataDbContext) { _sampleODataDbContext = sampleODataDbContext; _sampleODataDbContext.Persons.Add(new Person { Name = "Bob", Age = 30 }); _sampleODataDbContext.Persons.Add(new Person { Name = "Tom", Age = 30 }); _sampleODataDbContext.Persons.Add(new Person { Name = "Rob", Age = 33 }); _sampleODataDbContext.Persons.Add(new Person { Name = "Tim", Age = 21 }); _sampleODataDbContext.Persons.Add(new Person { Name = "Joe", Age = 45 }); _sampleODataDbContext.Persons.Add(new Person { Name = "Bart", Age = 38 }); _sampleODataDbContext.Persons.Add(new Person { Name = "Zoe", Age = 22 }); _sampleODataDbContext.SaveChanges(); }
public PersonController(SampleODataDbContext sampleODataDbContext) { SampleODataDbContext = sampleODataDbContext ?? throw new ArgumentNullException(nameof(sampleODataDbContext)); SampleODataDbContext.Database.EnsureCreated(); }
public PersonController(SampleODataDbContext sampleODataDbContext) { _sampleODataDbContext = sampleODataDbContext; }