SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff,
When I Update my old smartconnector extension from V2.2.130 to V2.4.7, I am getting few complie time error. One of the error is in below code. This code snippet is to get the Id of running update processor:
using (var db = MongooseObjectFactory.Current.GetInstance<IProcessConfigurationDataSource>())
{
IQueryable<ProcessConfiguration> updateProcessorConfig = db.ProcessConfigurations.Where(x => x.Name == ApplicationDefinitions.UpdateProcessorName);
ProcessConfiguration updateProcessorConfigVal = updateProcessorConfig.FirstOrDefault();
if (updateProcessorConfigVal != null)
{
updateProcessorId = updateProcessorConfigVal.Id;
}
}
ERROR -- CS1061 'IProcessConfigurationDataSource' does not contain a definition for 'ProcessConfigurations' and no extension method 'ProcessConfigurations' accepting a first argument of type 'IProcessConfigurationDataSource' could be found (are you missing a using directive or an assembly reference?)
##Where should I find the correct method? What is the best practice to do code lookup to replace obsolete/change methods usage ?
Thanks!
Neeraj Tomar
Link copied. Please paste this link to share this article on your social media post.
Hi Neeraj,
In this case what you are looking for is 'db.Items' instead of 'db.ProcessConfigurations'.
With the addition of Endpoint Configurations along with Processor Configurations in 2.3 there were some refactoring done in the core with regards to these interfaces.
In general, if an overload is obsoleted it is marked, but in this case since the whole interface changed, this was not done. So, in this case, your best bet to figure out the new link would have been to inspect the definition of IProcessConfigurationDataSource and then see IDataSource and look at that as well.
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Neeraj,
In this case what you are looking for is 'db.Items' instead of 'db.ProcessConfigurations'.
With the addition of Endpoint Configurations along with Processor Configurations in 2.3 there were some refactoring done in the core with regards to these interfaces.
In general, if an overload is obsoleted it is marked, but in this case since the whole interface changed, this was not done. So, in this case, your best bet to figure out the new link would have been to inspect the definition of IProcessConfigurationDataSource and then see IDataSource and look at that as well.
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
That helped ! Thanks.
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.