private ConsultantContext GetContextWithData() { var options = new DbContextOptionsBuilder <ConsultantContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options; var context = new ConsultantContext(options); context.Consultants.Add(new Consultant("Louis", "Broucke", "Junior .NET Developer", "Mechelen", "*****@*****.**", "0478529462", new DateTime(1991, 09, 14))); context.Consultants.Add(new Consultant("Koen", "Hublet", "Operations Manager", "Gent", "*****@*****.**", "0478529462", new DateTime(1991, 09, 14))); context.Consultants.Add(new Consultant("Nele", "Goovaerts", "HR Manager", "Mechelen", "*****@*****.**", "0478529462", new DateTime(1991, 09, 14))); context.Consultants.Add(new Consultant("Seppe", "Van Brabant", "Sales Manager", "Antwerpen", "*****@*****.**", "0478529462", new DateTime(1991, 09, 14))); context.Consultants.Add(new Consultant("Noortje", "Vanbutsele", "Sales Manager", "Leuven", "*****@*****.**", "0478529462", new DateTime(1991, 09, 14))); context.SaveChanges(); return(context); }
public SQLConsultantRepository(ConsultantContext context) { this.context = context; }