From 0cb3f28b827ef978e0dcb1b2f57dfd72b3bfafd7 Mon Sep 17 00:00:00 2001 From: sanjaykumar-suresh Date: Thu, 4 Dec 2025 19:03:45 +0530 Subject: [PATCH] 997072: UG Model Class Changes --- .../connecting-to-adaptors/custom-adaptor.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/blazor/datagrid/connecting-to-adaptors/custom-adaptor.md b/blazor/datagrid/connecting-to-adaptors/custom-adaptor.md index 0617e1667e..085b474389 100644 --- a/blazor/datagrid/connecting-to-adaptors/custom-adaptor.md +++ b/blazor/datagrid/connecting-to-adaptors/custom-adaptor.md @@ -215,6 +215,26 @@ The following sample code demonstrates how to inject a service into the Custom A @code{ + + protected override void OnInitialized() + { + Orders = Enumerable.Range(1, 75).Select(x => new Order() + { + OrderID = 1000 + x, + CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)], + Freight = 2.1 * x, + OrderDate = DateTime.Now.AddDays(-x), + }).ToList(); + } + + public class Order + { + public int? OrderID { get; set; } + public string CustomerID { get; set; } + public DateTime? OrderDate { get; set; } + public double? Freight { get; set; } + } + // Custom adaptor class that extends the DataAdaptor class. public class CustomAdaptor : DataAdaptor { @@ -985,6 +1005,26 @@ The following sample code demonstrates how to implement CRUD operations for cust @code{ + + protected override void OnInitialized() + { + Orders = Enumerable.Range(1, 75).Select(x => new Order() + { + OrderID = 1000 + x, + CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)], + Freight = 2.1 * x, + OrderDate = DateTime.Now.AddDays(-x), + }).ToList(); + } + + public class Order + { + public int? OrderID { get; set; } + public string CustomerID { get; set; } + public DateTime? OrderDate { get; set; } + public double? Freight { get; set; } + } + // Custom adaptor implementation by extending the DataAdaptor class. public class CustomAdaptor : DataAdaptor {