public static void CreateDbEntry(UserStory userStory, List <Criteria> criterias = null) { using (var db = new StoryDbContext()) { db.Stories.Add(userStory); if (criterias != null) { db.Criterias.AddRange(criterias); } db.SaveChanges(); } }