Is there way in next piece of code to only get the first record?
Dal.TreeHtmlExportsCollection treeHtmlExportsCollection =
new Dal.TreeHtmlExportsCollection().Where(Dal.TreeHtmlExports.Columns.TreeId, treeId).
OrderByDesc(Dal.TreeHtmlExports.Columns.DateCreated).Load();
You can do this using the Query tool like so: (requires SubSonic 2.1)
var query = new Select()
.Top("1")
.From(TreeHtmlExports.Schema)
.Where(TreeHtmlExports.Columns.TreeId).IsEqualTo(treeId)
.OrderDesc(TreeHtmlExports.Columns.DateCreated);
treeHtmlExportCollection = query.ExecuteAsCollection<TreeHtmlExportsCollection>();
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With