public IResult <ISubmodel> RetrieveSubmodel(string submodelId)
        {
            ISubmodelServiceProvider serviceProvider = GetSubmodelServiceProvider(submodelId);

            if (serviceProvider != null && serviceProvider.GetBinding() != null)
            {
                ISubmodel binding = serviceProvider.GetBinding();
                return(new Result <ISubmodel>(true, binding));
            }
            return(new Result <ISubmodel>(false, new NotFoundMessage("Submodel Service Provider")));
        }
        public IResult <ISubmodel> CreateSubmodel(ISubmodel submodel)
        {
            if (submodel == null)
            {
                return(new Result <ISubmodel>(new ArgumentNullException(nameof(submodel))));
            }
            RegisterSubmodelServiceProvider(submodel.IdShort, submodel.CreateServiceProvider());

            ISubmodelServiceProvider serviceProvider = GetSubmodelServiceProvider(submodel.IdShort);

            if (serviceProvider != null && serviceProvider.GetBinding() != null)
            {
                return(new Result <ISubmodel>(true, serviceProvider.GetBinding()));
            }
            else
            {
                return(new Result <ISubmodel>(false, new Message(MessageType.Error, "Could not retrieve Submodel Service Provider")));
            }
        }
Пример #3
0
 public ISubmodel GetBinding()
 {
     return(submodelServiceProvider.GetBinding());
 }