This C# project uses .NET DataStore from DWNet.Data for creating Web APIs. It makes use of the latest released Appeon PowerBuilder 2019 R2 (beta release, including SnapDevelop and SnapObjects), and shows how CRUD operations and transaction management works in .NET DataStore.
This is a C# project. This project uses .NET DataStore from DWNet.Data.
The project is structured as follows.
|—— .NET-DataStore-Example Implemented with .NET DataStore from DWNet.Data
|—— Appeon.DataStoreDemo.SqlServer For working with SQL Server
There is a ready-to-use example client application for you to test the Web APIs created from the project:
- PowerBuilder project. Download this PowerBuilder demo application, and use RESTClient in the application to call the Web APIs.
-
Open the PowerBuilder project in PowerBuilder 2019 R2 (beta release).
-
Open the C# project in SnapDevelop.
-
In NuGet Package Manager window in SnapDevelop, make sure that Internet connection is available and the option "Include prerelease" is selected, so that the NuGet package can be restored.
-
Download the SQL server database backup file from .NET-Project-Example-Database , and restore the database using the downloaded database backup file.
-
Open the configuration file appsettings.json in the project, modify the ConnectionStrings with the actual database connection information.
//Keep the database connection name as the default “AdventureWorks” or change it to a name you prefer to use, and change the Data Source, User ID, Password and Initial Catalog according to the actual settings "ConnectionStrings": { "AdventureWorks": "Data Source=127.0.0.1; Initial Catalog=AdventureWorks; Integrated Security=False; User ID=sa; Password=123456; Pooling=True; Min Pool Size=0; Max Pool Size=100; ApplicationIntent=ReadWrite" }
-
In the ConfigureServices method of Startup.cs, go to the following line, and make sure the ConnectionString name is the same as the database connection name specified in step #6.
//Note: Change "OrderContext" if you have changed the default DataContext file name; change the "AdventureWorks" if you have changed the database connection name in appsettings.json services.AddDataContext<OrderContext>(m => m.UseSqlServer(Configuration["ConnectionStrings:AdventureWorks"]));