public IActionResult ShippersLookup(DataSourceLoadOptions options) { return(DataSourceLoadResult.Create( from s in _nwind.Shippers orderby s.CompanyName select new { Value = s.ShipperID, Text = s.CompanyName }, options )); }
public IActionResult CustomersLookup(DataSourceLoadOptions options) { return(DataSourceLoadResult.Create( from c in _nwind.Customers orderby c.CompanyName select new { Value = c.CustomerID, Text = $"{c.CompanyName} ({c.Country})" }, options )); }
public IActionResult OrderDetails(int orderID, DataSourceLoadOptions options) { return(DataSourceLoadResult.Create( from i in _nwind.Order_Details where i.OrderID == orderID select new { i.Product.ProductName, i.UnitPrice, i.Quantity, Sum = i.UnitPrice * i.Quantity }, options )); }
public async Task <IActionResult> Appointments(DataSourceLoadOptions loadOptions) { var url = "https://www.googleapis.com/calendar/v3/calendars/" + "*****@*****.**" + "/events?key=" + "AIzaSyBnNAISIUKe6xdhq1_rjor2rxoI3UlMY7k"; using (var client = new HttpClient()) { var json = await client.GetStringAsync(url); var appointments = from i in JObject.Parse(json)["items"] select new { text = (string)i["summary"], startDate = (DateTime?)i["start"]["dateTime"], endDate = (DateTime?)i["end"]["dateTime"], recurrenceRule = "" // TODO consider replacing with '-expr' attribute in 15.2.6 }; return(DataSourceLoadResult.Create(appointments, loadOptions)); } }
public IActionResult Orders(DataSourceLoadOptions options) { return(DataSourceLoadResult.Create(_nwind.Orders, options)); }