Getting Started


To get DbNetSuiteCore up and running in your solution just follow these steps

Install the DbNetSuiteCore Nuget package

Using the package manager console

Install-Package DbNetSuiteCore

or via the .NET Core command line interface:

dotnet add package DbNetSuiteCore
Add DbNetSuiteCore middleware to your application pipeline

Add the lines indicated below to your program.cs file

using DbNetSuiteCore.Middleware;        // <-- Add this line

using Microsoft.AspNetCore.Builder;
WebApplicationBuilder builder=WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();

builder.Services.AddDbNetSuiteCore(); // <-- Add this line

builder.Services.AddHttpClient();
WebApplication app = builder.Build();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();

app.UseDbNetSuiteCore();                // <-- Add this line

app.Run();

Add the DbNetSuiteCore component to your Razor page


  • Include the styles used by the component with the @DbNetSuiteCore.Resources.StyleSheet() statement
  • Include the client-script used by the component with the @DbNetSuiteCore.Resources.ClientScript() statement
  • Build the GridModel by specifying the data source type, the connection string alias and the table or view to render
  • Call the GridControl Render() method passing in the GridModel

@using DbNetSuiteCore.Enums
@using DbNetSuiteCore.Models
@{
    Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
    @DbNetSuiteCore.Resources.StyleSheet()
</head>
<body>
    <main>
        @{
            GridModel customerGrid = new GridModel(DataSourceType.MSSQL, "Northwind", "Customers");
            @(await new DbNetSuiteCore.GridControl(HttpContext).Render(customerGrid))
        }
    </main>
    @DbNetSuiteCore.Resources.ClientScript()
</body>
</html>