CompositionAPI independent Datatypes

If I use HandleByQuery or HandleBySqlStatement I get have a resulting json which reflects the DB structure.

Now I need to provide a REST API for querying some date in the IdentityManager and I want to use my own DateStructure for the resulting json.

As simple example I've done this:

builder.AddMethod(Method.Define("eset")
.HandleGet(async qr =>{
    Query q = Query.From("ESet").Select("Ident_ESet").Where("UID_ESetType = N'e65d9baa-d737-4de9-a005-2f1f8f6263c8'");
    var entityRead = await qr.Session.Source().GetCollectionAsync(q);
    ESetList esets = new ESetList();

    foreach (var eset in entityRead){
        esets.esets.Add(new ESet() { Ident_ESet = eset.GetValue("Ident_ESet") });
    }
    return esets;
}));}

Now the Result looks like:

{
"Result": {
"esets": [
{
"Ident_ESet": "xxxx"
},
{
"Ident_ESet": "yyyy"
},
{
"Ident_ESet": "zzzz"

...

How can I get rid of the "Result:" entry?

I just need:

{

"esets": [

{
"Ident_ESet": "xxxx"
},
{
"Ident_ESet": "yyyy"
},
{
"Ident_ESet": "zzzz"

...

Or is there an easier way to do the request from scratch?

Parents
  • Now I've done some further work and I works in the Visual Studio. (The problem mentioned above still exists).

    When I apply that to the API Designer I'll get the error:

    Api0015;Await construct is missing ConfigureAwait(false) call (C...\One Identity\One Identity Manager\ApiDesigner\523DAFCF-51D2-4621-9004-3B253BE684EE\CSharpFiles\CCC_....cs: (45,48)-(45,140));CCC_..._ESET;;Await construct is missing ConfigureAwait(false) call (...\One Identity\One Identity Manager\ApiDesigner\523DAFCF-51D2-4621-9004-3B253BE684EE\CSharpFiles\CCC_.;;CSharp

    Any idea? Why does it work within the APISampleProject but not in the APIDesigner?

Reply
  • Now I've done some further work and I works in the Visual Studio. (The problem mentioned above still exists).

    When I apply that to the API Designer I'll get the error:

    Api0015;Await construct is missing ConfigureAwait(false) call (C...\One Identity\One Identity Manager\ApiDesigner\523DAFCF-51D2-4621-9004-3B253BE684EE\CSharpFiles\CCC_....cs: (45,48)-(45,140));CCC_..._ESET;;Await construct is missing ConfigureAwait(false) call (...\One Identity\One Identity Manager\ApiDesigner\523DAFCF-51D2-4621-9004-3B253BE684EE\CSharpFiles\CCC_.;;CSharp

    Any idea? Why does it work within the APISampleProject but not in the APIDesigner?

Children
No Data