public void TestThatTheCorrectSessionObjectIsReturnedForDifferentKeys() { const string Key1 = "key1", Key2 = "key2"; DatatableSessionObject <Person> object1 = new DatatableSessionObject <Person> { HasLastColumn = true }, object2 = new DatatableSessionObject <Person> { HasLastColumn = false }; _session.AddDatatableProperties(Key1, object1); _session.AddDatatableProperties(Key2, object2); Assert.That(_session.GetDatatableProperties <Person>(Key1), Is.EqualTo(object1)); Assert.That(_session.GetDatatableProperties <Person>(Key2), Is.EqualTo(object2)); }
/// <summary> /// Constructs the HTML of the datatable. /// </summary> /// <returns>The datatable as HTML</returns> public IHtmlString Finish() { var datatableSessionObject = new DatatableSessionObject <TEntity> { DatatableProperties = _properties, HasLastColumn = _hasLastColumn, LastColumn = _lastColumn, LastColumnHeader = _lastColumnHeader }; _session.AddDatatableProperties(_datatableId, datatableSessionObject); return(BuildHtmlString()); }