To get DbNetSuiteCore up and running in your solution just follow these steps
Using the package manager console
Install-Package DbNetSuiteCore
or via the .NET Core command line interface:
dotnet add package DbNetSuiteCore
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();
@DbNetSuiteCore.Resources.StyleSheet()
statement@DbNetSuiteCore.Resources.ClientScript()
statementGridModel
by specifying the data source type, the connection string alias and the table or view to renderRender()
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>