예제 #1
0
        public StoredProcedure AddStoredProcedure(String name, Int32 versionNumber, params SqlParameter[] sqlParameters)
        {
            name.Name("name").NotNullEmptyOrOnlyWhitespace();
              versionNumber.Name("versionNumber").GreaterThan(0);

              name = IdentifierHelper.GetBracketedSqlIdentifier(name);

              if (name.Contains("."))
            throw new ArgumentExceptionFmt(Properties.Resources.InvalidStoredProcedureNameForSchema, name);

              if (this.StoredProcedures.GetByName(name, versionNumber) == null)
              {
            var sp = new StoredProcedure(this, name, versionNumber, sqlParameters);
            this.StoredProcedures.Add(sp);
            return sp;
              }
              else
              {
            throw new ExceptionFmt(Properties.Resources.StoredProcedureAlreadyExists, name, versionNumber);
              }
        }
예제 #2
0
 public Column(StoredProcedure storedProcedure, String name)
     : this(storedProcedure.Schema.Database.Server.Configuration, name)
 {
     this.StoredProcedure = storedProcedure;
 }