private AllDataTypesNoColumnMeta WriteReadValidateUsingTableMethods(Table <AllDataTypesNoColumnMeta> table) { AllDataTypesNoColumnMeta expectedDataTypesRow = AllDataTypesNoColumnMeta.GetRandomInstance(); string uniqueKey = expectedDataTypesRow.StringType; // insert record _session.Execute(table.Insert(expectedDataTypesRow)); // select record List <AllDataTypesNoColumnMeta> listOfAllDataTypesObjects = (from x in table where x.StringType.Equals(uniqueKey) select x).Execute().ToList(); Assert.NotNull(listOfAllDataTypesObjects); Assert.AreEqual(1, listOfAllDataTypesObjects.Count); AllDataTypesNoColumnMeta actualDataTypesRow = listOfAllDataTypesObjects.First(); expectedDataTypesRow.AssertEquals(actualDataTypesRow); return(expectedDataTypesRow); }
private AllDataTypesNoColumnMeta WriteReadValidateUsingSessionBatch(Table <AllDataTypesNoColumnMeta> table) { Batch batch = _session.CreateBatch(); AllDataTypesNoColumnMeta expectedDataTypesRow = AllDataTypesNoColumnMeta.GetRandomInstance(); string uniqueKey = expectedDataTypesRow.StringType; batch.Append(table.Insert(expectedDataTypesRow)); batch.Execute(); List <AllDataTypesNoColumnMeta> listOfAllDataTypesObjects = (from x in table where x.StringType.Equals(uniqueKey) select x).Execute().ToList(); Assert.NotNull(listOfAllDataTypesObjects); Assert.AreEqual(1, listOfAllDataTypesObjects.Count); AllDataTypesNoColumnMeta actualDataTypesRow = listOfAllDataTypesObjects.First(); expectedDataTypesRow.AssertEquals(actualDataTypesRow); return(expectedDataTypesRow); }