public void ClearDb() { using (var context = new MemeAPIContext(options)) { context.MemeItem.RemoveRange(context.MemeItem); context.SaveChanges(); }; }
public void SetupDb() { using (var context = new MemeAPIContext(options)) { MemeItem memeItem1 = new MemeItem() { Title = memeTitles[0] }; MemeItem memeItem2 = new MemeItem() { Title = memeTitles[1] }; context.MemeItem.Add(memeItem1); context.MemeItem.Add(memeItem2); context.SaveChanges(); } }