1. Simone Olianti
  2. SnapDevelop
  3. Friday, 22 January 2021 18:32 PM UTC

Hello everyone i've successfully migrated to PB 2019 R3. Im trying to rebuild also my snapdevelop webapi project.

The rebuild finished without errors but with some warnings that i show here:

1>------ Rebuild started: Project: StartWebApi2.csproj, Configuration: Debug AnyCPU ------
0>\DataContextBaseNETDataStoreAsa.cs (6,51) : warning CS0618 : 'OdbcDataContext' è obsoleto: 'OdbcDataContext class is deprecated, please use SqlAnywhereDataContext class instead.'
0>\DataContextDefault.cs (6,39) : warning CS0618 : 'OdbcDataContext' è obsoleto: 'OdbcDataContext class is deprecated, please use SqlAnywhereDataContext class instead.'
0>\DataContextBaseSqlModelMapperAsa.cs (6,53) : warning CS0618 : 'OdbcDataContext' è obsoleto: 'OdbcDataContext class is deprecated, please use SqlAnywhereDataContext class instead.'
0>\DataContextBaseModelStoreAsa.cs (6,50) : warning CS0618 : 'OdbcDataContext' è obsoleto: 'OdbcDataContext class is deprecated, please use SqlAnywhereDataContext class instead.'
0>\DataContextBaseNETDataStoreAsa.cs (9,24) : warning CS0618 : 'OdbcDataContextOptions<DataContextBaseNETDataStoreAsa>' è obsoleto: 'OdbcDataContextOptions<TAdoDbContext> class is deprecated, please use OdbcSqlAnywhereDataContextOptions<TAdoDbContext> class instead.'
0>\DataContextBaseModelStoreAsa.cs (9,24) : warning CS0618 : 'OdbcDataContextOptions<DataContextBaseModelStoreAsa>' è obsoleto: 'OdbcDataContextOptions<TAdoDbContext> class is deprecated, please use OdbcSqlAnywhereDataContextOptions<TAdoDbContext> class instead.'
0>\DataContextBaseSqlModelMapperAsa.cs (9,24) : warning CS0618 : 'OdbcDataContextOptions<DataContextBaseSqlModelMapperAsa>' è obsoleto: 'OdbcDataContextOptions<TAdoDbContext> class is deprecated, please use OdbcSqlAnywhereDataContextOptions<TAdoDbContext> class instead.'
0>\DataContextDefault.cs (9,24) : warning CS0618 : 'OdbcDataContextOptions<DataContextDefault>' è obsoleto: 'OdbcDataContextOptions<TAdoDbContext> class is deprecated, please use OdbcSqlAnywhereDataContextOptions<TAdoDbContext> class instead.'
0>\DataContextFactoryModelStore.cs (67,32) : warning CS0618 : 'OdbcDataContextOptions' è obsoleto: 'OdbcDataContextOptions class is deprecated, please use OdbcSqlAnywhereDataContextOptions class instead.'
0>\DataContextFactorySqlModelMapper.cs (66,32) : warning CS0618 : 'OdbcDataContextOptions' è obsoleto: 'OdbcDataContextOptions class is deprecated, please use OdbcSqlAnywhereDataContextOptions class instead.'
0>\DataContextFactorySqlModelMapper.cs (75,31) : warning CS0618 : 'OdbcDataContextOptions' è obsoleto: 'OdbcDataContextOptions class is deprecated, please use OdbcSqlAnywhereDataContextOptions class instead.'
0>\DataContextFactoryModelStore.cs (76,31) : warning CS0618 : 'OdbcDataContextOptions' è obsoleto: 'OdbcDataContextOptions class is deprecated, please use OdbcSqlAnywhereDataContextOptions class instead.'
0>\DataContextFactoryNETDataStore.cs (65,32) : warning CS0618 : 'OdbcDataContextOptions' è obsoleto: 'OdbcDataContextOptions class is deprecated, please use OdbcSqlAnywhereDataContextOptions class instead.'
0>\DataContextFactoryNETDataStore.cs (74,31) : warning CS0618 : 'OdbcDataContextOptions' è obsoleto: 'OdbcDataContextOptions class is deprecated, please use OdbcSqlAnywhereDataContextOptions class instead.'
0>\Startup.cs (51,62) : warning CS0618 : 'OdbcExtensions.UseOdbc<TAdoDbContext>(IDataContextOptions<TAdoDbContext>, string)' è obsoleto: 'UseOdbc method is deprecated, please use UseSqlAnyWhere method instead.'
1> StartWebApi2 -> S:\start2\WEBAPI\Start Web Api 2\StartWebApi2\bin\Debug\netcoreapp2.1\StartWebApi2.dll
========== Rebuild: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

im connecting using Sql Anywhere 16 ODBC driver but looks like it is obsolete. 
Also when i publish my project i get an internal server error anytime i try to do a CRUD operation on my .net converted datastores. Any suggestions?

tia

p.s. on Snapdevelop 2019 R2 everything working fine

Accepted Answer
Arnd Schmidt Accepted Answer Pending Moderation
  1. Saturday, 23 January 2021 00:29 AM UTC
  2. SnapDevelop
  3. # Permalink

You should study the Code Example under:

C:\Users\Public\Documents\Appeon\PowerBuilder 19.0\Code Examples\Example Sales App\Restful_PB\.net-datastore_asa

Open the .NET-DataStore-Example.sln with SNAP Develop 2019 R3.

There you find how to code your DataContext Class (now inherited from SqlAnywhereDataContext )  and how to set the DataContext Options in the Startup.cs.

Furthermore https://github.com/Appeon also offers examples.

hth

Arnd

Comment
  1. shoaib siddiqui
  2. Friday, 16 July 2021 16:41 PM UTC
This example requires SQLServer, where can I find for SQLAnyewhere database.
  1. Helpful
There are no comments made yet.
Simone Olianti Accepted Answer Pending Moderation
  1. Saturday, 23 January 2021 10:25 AM UTC
  2. SnapDevelop
  3. # 1

thank you Arnd, that helped alot! Also i was missing some parts from the Upgrade Guide.

Now i have another question.

I am using JWT tokens for the user authentication inside my web api but obviously after the upgrade to netcore 3.1 stopped to work.

using Microsoft.AspNetCore.Authentication.JwtBearer;   <--- is not working anymore

any ideas if there is a way to upgrade the jwt implementation after the upgrade?

thx again in advance

 

ok, my fault :D i was trying to install Microsoft.AspNetCore.Authentication.JwtBearer v5.0 lol

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.