ADO.NET Provider for Sage Intacct

Build 25.0.9434

EF Core ASP.NET Application

Registering the Context with Dependency Injection

To enable dependency injection for SageIntacctContext, you must register it with the service container. In newer ASP.NET Core projects (using the minimal hosting model), this is done in Program.cs. In older projects, the code may go in Startup.cs.

using MySolutionName.Models;
using Microsoft.EntityFrameworkCore;

var connection = @"User='myusername';CompanyID='TestCompany';Password='mypassword';SenderID='Test';SenderPassword='abcde123';";
builder.Services.AddDbContext<SageIntacctContext>(options =>
    options.UseSageIntacct(connection));

Creating a Controller and Views

To create a controller and views for your web app, follow these steps:

  1. Right-click the Controllers folder in the Solution Explorer and select Add -> Controller...
  2. Choose MVC Controller with views, using Entity Framework, and then click Add.
  3. Set the Model Class to the class corresponding to your table or view and set the Data context class to SageIntacctContext.
  4. Click Add. Take note of the controller name.

Running Your Application

Once the controller and views are set up, you can run your application by selecting Debug -> Start Without Debugging. Your browser will open automatically. To view your data, navigate to: Now that the controllers and views have been setup, you can launch your app using Debug -> Start Without Debugging. The app will then launch in your browser. You can find your data by navigating to <base URL>/<controller name without the "Controller" suffix>

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434