Esempio n. 1
0
 ///<summary>
 ///</summary>
 ///<param name="dict"></param>
 ///<param name="key"></param>
 ///<param name="assoc_info"></param>
 ///<exception cref="Exception"></exception>
 public static void AddRequiredParameter(IDictionary <string, string> dict, string key,
                                         assoc_object_type assoc_info)
 {
     if (!(assoc_info == null))
     {
         var assoc = new Dictionary <string, string>
         {
             { "alias", assoc_info.alias },
             { "object_type", assoc_info.object_type },
             { "unique", assoc_info.unique.ToString() }
         };
         AddJSONAssociativeArray(dict, key, assoc);
     }
     else
     {
         throw new Exception(string.Format("Error: Parameter '{0}' is required.", key));
     }
 }
Esempio n. 2
0
        public void defineAssociationTest()
        {
            DropAssociations();
            createObjectTypeTest();
            string            name        = Constants.TestAssociationDefName;
            int               assoc_type  = 2;
            assoc_object_type assoc_info1 = new assoc_object_type
            {
                alias       = Constants.TestAssociationDefAlias1,
                object_type = Constants.TestType
            };
            assoc_object_type assoc_info2 = new assoc_object_type
            {
                alias       = Constants.TestAssociationDefAlias2,
                object_type = Constants.TestType
            };
            bool?inverse = null;

            _apiWeb.Data.DefineAssociation(name, assoc_type, assoc_info1, assoc_info2, inverse);
        }
Esempio n. 3
0
        public void defineAssociationTest()
        {
            DropAssociations();
            createObjectTypeTest();
            API               parent      = _api;
            data              target      = new data(parent);
            string            name        = Constants.TestAssociationDefName;
            int               assoc_type  = 2;
            assoc_object_type assoc_info1 = new assoc_object_type
            {
                alias       = Constants.TestAssociationDefAlias1,
                object_type = Constants.TestType
            };
            assoc_object_type assoc_info2 = new assoc_object_type
            {
                alias       = Constants.TestAssociationDefAlias2,
                object_type = Constants.TestType
            };
            bool?inverse = null;

            target.defineAssociation(name, assoc_type, assoc_info1, assoc_info2, inverse);
        }