SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Posted: 2018-01-30 07:41 AM
Link copied. Please paste this link to share this article on your social media post.
I'm trying to get a specific value Item from the CustomSetValues Data adapter. When I use the normal processor adapter I can use a link statement to query it, like this
var guestInRoom =DataAdapter.ValueItems.FirstOrDefault( x => x.AlternateId == folderRoomHotel.AlternateId + "/GuestInRoom");
But the CustomSetValues adapter won't allow me to, how should I get a specific valueItem from the adapter list other than a foreach loop ?
Link copied. Please paste this link to share this article on your social media post.
Hi James,
Can you give us more details about how it is not letting you? Are you receiving an exception, or is the method simply not available to you?
Regards,
-Jeff
Posted: 2018-01-30 07:56 AM
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff,
The Methods for the list are not available. So I have no way to query it.
Thanks the quick reply.
James
Link copied. Please paste this link to share this article on your social media post.
Hi James,
Can you share your class with me so that I can take a look? Feel free to send it via email. As far as I can tell, something like the below should work just fine.
Regards,
-Jeff
public class CustomSetValues : MongooseSetValuesProcessor
{
protected override ResultType SetValue(ValueTypeStateless item)
{
var someValueItem = DataAdapter.Values.FirstOrDefault(a => a.AlternateId == "some id")
base.SetValue(item)
}
}
Posted: 2018-01-30 08:11 AM
Link copied. Please paste this link to share this article on your social media post.
Here's a screen shot of the available methods the query methods are not present. The standard data adapter has options for FirstorDefault etc as your example shows.
Link copied. Please paste this link to share this article on your social media post.
Hi James,
I think you may be missing some "Using" statements. Please make sure that:
using System;
using System.Collections.Generic;
using System.Linq;
Are also being referenced in your code.
Regards,
-Jeff
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.