BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
@page "/"
@using Syncfusion.EJ2.RazorComponents.Grids;
@using WebApplication1.Shared.Models;
@using Syncfusion.EJ2.RazorComponents.Data
<EjsGrid id="Grid" ref="@grid" AllowSorting="true">
<EjsDataManager Url="/api/Default" Adaptor="Adaptors.WebApiAdaptor"></EjsDataManager>
<GridColumns>
<GridColumn Field="EmployeeID" HeaderText="Employee ID" ISPrimaryKey="true" TextAlign="@Syncfusion.EJ2.RazorComponents.Grids.TextAlign.Right" Width="90"></GridColumn>
<GridColumn Field="FirstName" HeaderText="First Name" Width="90"></GridColumn>
<GridColumn Field="LastName" HeaderText=" Last Name" Width="90"></GridColumn>
<GridColumn Field="City" HeaderText="City" Width="150"></GridColumn>
</GridColumns>
</EjsGrid>
@functions{
Employee[] data;
EjsGrid grid;
}
|
...
namespace WebApplication1.Server.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class DefaultController : ControllerBase
{
EmployeeDataAccessLayer objemployee = new EmployeeDataAccessLayer();
// GET: api/Default
[HttpGet]
public object Get()
{
IEnumerable<Employee> data = objemployee.GetAllEmployees().ToList();
return new { Items = data, Count = data.Count() }; }
// GET: api/Default/5
[HttpGet("{id}", Name = "Get")]
...
}
}
|
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddNewtonsoftJson(options => {
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
});
...
} |
$inlinecount=allpages
$orderby=ColName%20desc
$skip=0
$top=12
int count = DataSource.Cast<OrdersDetails>().Count();
if (dm.Skip != 0)
{
DataSource = operation.PerformSkip(DataSource, dm.Skip); //Paging
}
if (dm.Take != 0)
{
DataSource = operation.PerformTake(DataSource, dm.Take);
}
. . . |