private IEnumerable <SpModel> GetTestData(DbContext db) { var one = new SpModel(); db.Entry(one).Property(SpModel.SpLong).CurrentValue = (long)10; db.Entry(one).Property(SpModel.SpNullableLong).CurrentValue = null; db.Entry(one).Property(SpModel.SpDateTime).CurrentValue = new DateTime(2021, 02, 14); yield return(one); }
private IEnumerable <SpModel> GetTestData(DbContext db, bool useEf, int count) { var data = new List <SpModel>(); for (int i = 0; i < count; i++) { var one = new SpModel(); if (useEf) { db.Entry(one).Property(SpModel.SpLong).CurrentValue = (long)10; db.Entry(one).Property(SpModel.SpNullableLong).CurrentValue = null; db.Entry(one).Property(SpModel.SpDateTime).CurrentValue = new DateTime(2021, 02, 14); } data.Add(one); } return(data); }