LINQ code exampe to query a collection in web portal.

Hi there!

In v8.1 I'm playing around with LINQ to query a custom schema collection in a code snippet. I know how to make the query but I seem to be unable to find a method to work with the columns and the results.

Let's say:

var tablaconsulta = from fila in AltaMasiva select fila; 

foreach(var linea in tablaconsulta)
{
Logger.Info("Registros leidos: " + linea.Field<string>("NIF"));
}

, where AltaMasiva is a custom schema collection and "NIF" one of its columns. I always get an error addressing any column. I've tried linea["NIF"] , etc.. to no avail either. Any examples on how to do it? 

Thanks!

Parents Reply
  • Thanks a lot Markus, can't wait for the next version :)  

    In my case at least this is not what I meant. The Web Designer has an object "Code Snippet" which you can use to insert c# in your development. You can use linq in this c# code , along with an extensive OneIdentity API which is not documented. My own snippets have been created by consulting all the code from the OOB IdentityManager web site and following a trial-error sequence to see "if that works" , slowing the whole programming task a lot. Using linq eases the query process but I dont know how to get some results back. 

    Another object is thet .net Object Collection , for example. It has a mandatory field "List element type" which I dont know either how to fill up or where to lookup in the documentation. 

    Again, thanks for your help.

Children