Skip to content

Commit c2e8e06

Browse files
genexusbotcmurialdo
authored andcommitted
Fix Object reference not set in BCs as rest services
1 parent 6fe3b1a commit c2e8e06

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Suppose you do a fix in GxClasses project. In order to get that fix in your gene
9999
```UpdateAssemblyReference.exe -assembly <KB>\CSharpModel\web\bin\GxClasses.dll -d <KB>\CSharpModel\web\bin```
100100
- To get UpdateAssemblyReference.exe build [UpdateAssemblyReference.sln](dotnet/tools/updateassemblyreference/UpdateAssemblyReference.sln)
101101
4. Since GxClasses references other assemblies, it is needed to keep that references unchanged. So this command will patch the new GxClasses.dll to reference the original ones:
102+
102103
```UpdateAssemblyReference.exe -a <KB>\CSharpModel\web\bin\GxCryptography.dll -d <KB>\CSharpModel\web\bin```
103104
```UpdateAssemblyReference.exe -a <KB>\CSharpModel\web\bin\GxCryptographyCommon.dll -d <KB>\CSharpModel\web\bin```
104105
```UpdateAssemblyReference.exe -a <KB>\CSharpModel\web\bin\GxEncrypt.dll -d <KB>\CSharpModel\web\bin```

dotnet/src/dotnetcore/GxClasses/Services/CoreWebAPI/Controller/GXBCRestService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public GXBCRestService(GxSilentTrnSdt sdt, HttpContext context, IGxContext gxCon
2323
{
2424
_worker = sdt;
2525
}
26-
26+
protected override GXBaseObject Worker => _worker.trn as GXBaseObject;
2727
public override Task Post()
2828
{
2929
try

dotnet/src/dotnetframework/GxClasses/Services/GxRestWrapper.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public GxRestWrapper(HttpContext context, IGxContext gxContext)
5353
AddHeader("Content-type", "application/json; charset=utf-8"); //MediaTypesNames.ApplicationJson);
5454
RunAsMain = true;
5555
}
56-
56+
protected virtual GXBaseObject Worker
57+
{
58+
get { return _procWorker; }
59+
}
5760
public virtual void Cleanup()
5861
{
5962
if (RunAsMain)
@@ -260,7 +263,7 @@ public bool IsAuthenticated(string synchronizer)
260263
}
261264
public bool IsAuthenticated()
262265
{
263-
return IsAuthenticated(_procWorker.IntegratedSecurityLevel2, _procWorker.IntegratedSecurityEnabled2, _procWorker.ExecutePermissionPrefix2);
266+
return IsAuthenticated(Worker.IntegratedSecurityLevel2, Worker.IntegratedSecurityEnabled2, Worker.ExecutePermissionPrefix2);
264267
}
265268
private bool IsAuthenticated(GAMSecurityLevel objIntegratedSecurityLevel, bool objIntegratedSecurityEnabled, string objPermissionPrefix)
266269
{

0 commit comments

Comments
 (0)