At the end of the year, it is a pity because of various reasons. However, in order to give everyone a compensation, the following dedication to the use of LOR's C # code, see what LOR is with other O / R mapping products.
BookList Books = (BookList) Datacenter.query ("Select {book.price} from {book} where year ({book.publishedDate}) = 1993 and {book.authors.lastname} = 'Zhang'");
Foreach (book book in books) {
Book.authors [0] .lastname.value = "Yuan";
IF (Book.Price. Regalid (Book.Price.Value * 0.80)) {
Book.price.value = BOOK.PRICE.VALUE * 0.80;
}
}
// The entire list is used as a transaction.
SaveResult result = books.save ();
IF (result.failed) {
IF (Result.FaiLeDreason == FaileDreason.dataconflict) {
Result.commitoverwrite ();
// Result.Ignore ();
} else {
Result.rollback ();
}
}
// // Binding to the user control. //
Books.defaultView.bind ("C #", new string [] {"name", "price", "authors name = authors [*]. name"});
Books.defaultView.Filter ("C #", "Authors.count> 1 && Authors [*]. Address.city == /" Changchun / ");
Books.defaultview.sort ("C #", new string [] {"price, des", "name, ASC", "Authors [0] .name, ASC"});
THIS.DATAGRID1.DATASOURCE = BOOKS;
BookList Books = (BookList) Datacenter.query ("Select {book.price} from {book} where year ({book.publishedDate}) = 1993 and {book.authors.lastname} = 'Zhang'");
Foreach (book book in books) {
Book.authors [0] .lastname.value = "Yuan";
IF (Book.Price. Regalid (Book.Price.Value * 0.80)) {
Book.price.value = BOOK.PRICE.VALUE * 0.80;
}
}
// The entire list is used as a transaction.
SaveResult result = books.save ();
IF (result.failed) {
IF (Result.FaiLeDreason == FaileDreason.dataconflict) {
Result.commitoverwrite ();
// Result.Ignore ();
Else {result.rollback ();
}
}
// // Binding to the user control. //
Books.defaultView.bind ("C #", new string [] {"name", "price", "authors name = authors [*]. name"});
Books.defaultView.Filter ("C #", "Authors.count> 1 && Authors [*]. Address.city == /" Changchun / ");
Books.defaultview.sort ("C #", new string [] {"price, des", "name, ASC", "Authors [0] .name, ASC"});
THIS.DATAGRID1.DATASOURCE = BOOKS;
BookList Books = (BookList) Datacenter.query ("Select {book.price} from {book} where year ({book.publishedDate}) = 1993 and {book.authors.lastname} = 'Zhang'");
Foreach (book book in books) {
Book.authors [0] .lastname.value = "Yuan";
IF (Book.Price. Regalid (Book.Price.Value * 0.80)) {
Book.price.value = BOOK.PRICE.VALUE * 0.80;
}
}
// The entire list is used as a transaction.
SaveResult result = books.save ();
IF (result.failed) {
IF (Result.FaiLeDreason == FaileDreason.dataconflict) {
Result.commitoverwrite ();
// Result.Ignore ();
} else {
Result.rollback ();
}
}
// // Binding to the user control. //
Books.defaultView.bind ("C #", new string [] {"name", "price", "authors name = authors [*]. name"});
Books.defaultView.Filter ("C #", "Authors.count> 1 && Authors [*]. Address.city == /" Changchun / ");
Books.defaultview.sort ("C #", new string [] {"price, des", "name, ASC", "Authors [0] .name, ASC"});
THIS.DATAGRID1.DATASOURCE = BOOKS;
The above is an example written by a C # source code obtained with Lor, which shows a part of the LOR unique under the .NET platform. The displayed method shown here is only decided in the current design phase, and it is very likely to change in the later period, so stay tuned! ^ _ ^