What's New in C# Development and Migration
Last Updated: July 2020
This document lists all the new features introduced by the release of the following products:
- SnapDevelop 2019 R2 (with DataWindow Converter plug-in and PowerScript Migrator plug-in)
- .NET DataStore 2.x (DWNet.Data and DWNet.Data.AspNetCore)
- PowerScript Migrator Framework 1.0.x
- SnapObjects 2.x
The above products are included in both the PowerBuilder product bundle and the RapidSharp product bundle, with only slight differences on license control, APIs, and bug fixes.
For license differences, please refer to the following section for details.
For API differences, please refer to List of New or Changed APIs.
SnapDevelop now includes the following license control mechanism:
Users must log in with an account registered on the Appeon website to start working in SnapDevelop.
SnapDevelop IDE can be installed from either PowerBuilder product bundle or RapidSharp product bundle. The table below explains the features that are available to an user account depending on the product bundle license associated with the account:
License Type Common SnapDevelop IDE Features; SnapObjects .NET DataStore; DataWindow Converter PowerScript Migrator PowerBuilder product bundle Standard License Yes No No Professional License Yes Yes No CloudPro License Yes Yes Yes Trial edition Yes Yes Yes No license Yes No No RapidSharp product bundle Paid edition Yes Yes Yes Trial edition Yes Yes Yes No license Yes No No
SnapDevelop IDE instances installed from different product bundles (PowerBuilder or RapidSharp) are regarded as separate products. This means, although it is not possible to simultaneously run two major versions of SnapDevelop IDE from the same product bundle, you can simultaneously run two SnapDevelop IDE instances from PowerBuilder product bundle and RapidSharp product bundle.
If you launch SnapDevelop from the Window start menu, you may be requested to enter the account information and manually log in.
SnapDevelop requires Internet connection to validate the user account, except that with SnapDevelop installed from PowerBuilder product bundle, you can select "Activate without internet" link, to activate with the same offline license that is used to activate PowerBuilder on the same computer.
With SnapDevelop installed from PowerBuilder product bundle, if you launch SnapDevelop by clicking the SnapDevelop icon in PowerBuilder IDE, you are automatically logged in to SnapDevelop with the account that you use to log in to PowerBuilder IDE.
Changes to NuGet Libraries
The previous PowerBuilder.Data NuGet library is renamed to DWNet.Data;
The previous PowerBuilder.Data.AspNetCore is renamed to DWNet.Data.AspNetCore;
A new NuGet library is provided: PowerScript.Bridge. It provides pure C# implementation of various non-visual PowerScript constructs to accelerate migrating PowerScript to C#.
Refactored .NET DataStore
The whole implementation of .NET DataStore is different from 2019 GA. .NET DataStore implemented in 2019 GA version must work with the original PB DataWindow SRD file. It was a major limitation that makes .NET DataStore not maintainable directly in SnapDevelop. Now with 2019 R2, .NET DataStore has removed the dependency on the original DataWindow SRD file. If you want to continue using .NET DataStore, it is strongly recommended that you re-generate .NET DataStore from PowerBuilder DataWindows/DataStores in this version.
Along with this change, a new set of .NET DataStore APIs are provided, and the existing APIs have a few changes. For details, see List of New or Changed APIs.
Changes to SnapObjects .NET APIs
SqlModelMapper, SqlExecutor, and Web APIs have been enhanced in 2019 R2,
- New attributes for model class and property
- New APIs for exporting/importing XML for DataStores
- DataTable supports standard data format
- Supports generic DataStores
- SqlModelMapper supports to track DataStore
For details, see List of New or Changed APIs.
Open PB Workspace
You can right click a solution in the Solution Explorer and select Open PB Workspace. If you open a PowerBuilder workspace in SnapDevelop, the workspace displays in the Solution Explorer with all its targets, libraries and objects.
With a PB workspace opened as read-only in SnapDevelop, you can perform these operations on selected DataWindows/DataStores or userobjects :
- Convert DataWindow to C# model.
- Open PowerScript as read-only in the editor and then convert PowerScript to C#.
DataWindow Converter is renamed from the C# Model Generator that was previously available in PowerBuilder IDE. And DataWindow Converter is now solely available in SnapDevelop. There are two main changes with this feature:
- DataWindow XML templates can be converted to C# together with the DataWindow;
- The generated C# models no longer have dependencies on the SRD files.
For details, see Working with DataWindow Converter.
After you open a PB workspace, you can open PowerScript as read-only in the editor and then translates non-visual PowerBuilder code and objects (including PowerScript, embedded SQLs, DataWindows/DataStores, and NVOs) to C#. The translation can be performed to individual functions, or to a complete NVO (.sru).
For details, see PowerScript Migrator.
SnapDevelop's SQL Query allows you to view data from the database, write and execute your SQL statements, select particular ways in which your query results display, see how your SQL statements are executed, and export the query results to an external file. It currently supports connection to the following databases: SQL Server, Oracle, PostgreSQL, MySql, SQLite, and ODBC (any ODBC-compliant database).
For details, see Using SQL Query.
Scaffolding is a technique to effectively create templates for services and controllers which can be used to easily build a C# application.
For details, see Scaffolding.
Relevant with the scaffolding feature, SnapDevelop IDE also enables you to right click in the ConfiguerServices method and then select Inject Service or Inject DataContext to implement dependency injection in the project.
Publish to Docker
SnapDevelop 2019 R2 supports publishing C# projects to Docker. So far, SnapDevelop supports three ways of publication: Web Deploy, File System, and Docker.
For details, see Publishing a Project with Docker.
Export From or Import To Data Models
It is now possible to export XML from .NET DataStore or import XML into .NET DataStore, or use templates to export XML or JSON from .NET DataStore or SnapObjects models.
For .NET APIs added to support the export/import, see New or Changed APIs. For detailed specification on how to define an XML or JSON template to export data from .NET DataStore or SnapObjects models, see Using Export Templates for XML or JSON Export.
For a sample project on how to execute XML export from .NET DataStore, see https://github.com/Appeon/.NETDataStore-XML-Export-Example.
Web API Tester
If you create a Web API project, you can use the Web API Tester to test Web APIs locally to check requests and responses.
The Web API tester provides you with:
A friendly GUI for constructing requests and reading responses;
Normal testing mode and debug testing mode;
Three auth models (basic authentication, bearer token, and OAuth 2.0) for authenticating the requests;
Enabling cookies in the requests and responses;
Ability to set query, and path parameters with your request URL. Query and path parameters are added to the request URL: query parameters follow "?" and query parameters follow ":"
Ability to send data models (such as .NET DataStore or DataPacker) as body parameters in requests.
The Web API Tester can support complicated data models as testing parameters in Web API requests that perform CRUD operations.
For details, see Testing with Web API Tester.