Type safe way of passing ID's around. Also allows complete abstraction from implementation for user.
예제 #1
0
        /// <summary>
        /// Returns the value of the tag as a string
        /// </summary>
        /// <param name="objectID"></param>
        /// <returns></returns>
        public string GetValue(FluidDBGUID objectID)
        {
            // send get request with parameters in URI (.net does not allow you to use the payload
            HttpWebResponse r = Connection.Call(METHOD.GET, "/objects/" + objectID.ID + "/" + Name, null, FluidConnector.PrimitivePutType, "");

            if (r.StatusCode == HttpStatusCode.OK)
            {
                string value = Connection.GetRawResult(r);
                // remove quotes
                return value.Remove(0,1).Remove(value.Length - 2,1);
            }
            else
            {
                return null;
            }
        }
예제 #2
0
        /// <summary>
        /// Returns the tag value as a string, must use this method if value is stored with a custom content type
        /// </summary>
        /// <param name="objectID"></param>
        /// <param name="contentType"></param>
        /// <returns></returns>
        public string GetValue(FluidDBGUID objectID, string contentType)
        {
            // send get request with parameters in URI (.net does not allow you to use the payload
            HttpWebResponse r = Connection.Call(METHOD.GET, "/objects/" + objectID.ID + "/" + Name, null, contentType, "");

            if (r.StatusCode == HttpStatusCode.OK)
            {
                string value = Connection.GetRawResult(r);
                return value;
            }
            else
            {
                return null;
            }
        }