コード例 #1
0
        /// <summary>
        /// Create foreign key constraint
        /// </summary>
        /// <param name="model">Relationship model</param>
        /// <returns>Exception message if failed, NULL if not</returns>
        public string AddRelationship(RelationshipModel model)
        {
            var ctx = new DatabaseContext(SessionProvider.Instance.ConnectionType);

            try
            {
                ctx.AddRelationship(model);
                return(null);
            }
            catch (Exception exception) when(exception is SqlException || exception is OracleException)
            {
                Output.WriteLine(OutputPanelListener.PrepareException(exception.Message));
                return(exception.Message);
            }
        }