Esempio n. 1
0
        /// <summary>
        /// Adds the specified map.
        /// </summary>
        /// <param name="procedureName">Name of the procedure.</param>
        /// <param name="dbName">Name of the db.</param>
        /// <param name="type">The type.</param>
        /// <param name="body">The body.</param>
        /// <param name="supportedRdbms">The supported RDBMS.</param>
        /// <returns></returns>
        public StatementMap Add(string procedureName, string dbName, MappedStatementType type, string body, string supportedRdbms)
        {
            var proc = new StatementMap(procedureName, dbName, type)
            {
                Body = body, CanRunOn = supportedRdbms
            };

            Add(proc);
            return(proc);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds the specified map.
        /// </summary>
        /// <param name="map">The map.</param>
        /// <param name="dbName">Name of the db.</param>
        /// <param name="type">The type.</param>
        /// <param name="body">The body.</param>
        /// <param name="supportedRdbms">The supported RDBMS.</param>
        /// <returns></returns>
        public StatementMap Add(EntityMap map, string dbName, MappedStatementType type, string body, string supportedRdbms)
        {
            string procName = BuildMappedStatementName(map, type);
            var    proc     = new StatementMap(procName, dbName, type)
            {
                Body = body, CanRunOn = supportedRdbms, DependsOnEntity = map.FullName
            };

            Add(proc);
            return(proc);
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StatementMap"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="dbName">Name of the db.</param>
 /// <param name="operationType">Type of the operation.</param>
 public StatementMap(string name, string dbName, MappedStatementType operationType)
 {
     Name          = name;
     DbName        = dbName;
     OperationType = operationType;
 }
Esempio n. 4
0
        /// <summary>
        /// Adds the specified map.
        /// </summary>
        /// <param name="map">The map.</param>
        /// <param name="type">The type.</param>
        /// <param name="body">The body.</param>
        public StatementMap Add(EntityMap map, MappedStatementType type, string body)
        {
            string procName = BuildMappedStatementName(map, type);

            return(Add(procName, procName, type, body, Platform.Id));
        }
Esempio n. 5
0
 /// <summary>
 /// Builds the name of the procedure.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="procType">Type of the proc.</param>
 /// <returns></returns>
 public static string BuildMappedStatementName(Type type, MappedStatementType procType)
 {
     return(string.Format("{0}_{1}", type.FullName, procType));
 }
Esempio n. 6
0
 /// <summary>
 /// Builds the name of the procedure.
 /// </summary>
 /// <param name="map">The map.</param>
 /// <param name="type">The type.</param>
 /// <returns></returns>
 public static string BuildMappedStatementName(EntityMap map, MappedStatementType type)
 {
     return(string.Format("{0}_{1}", map.FullName, type));
 }
Esempio n. 7
0
        /// <summary>
        /// Tries the get value.
        /// </summary>
        /// <param name="map">The map.</param>
        /// <param name="procType">Type of the proc.</param>
        /// <param name="val">The val.</param>
        /// <returns></returns>
        public bool TryGetValue(EntityMap map, MappedStatementType procType, out StatementMap val)
        {
            var procName = BuildMappedStatementName(map, procType);

            return(TryGetValue(procName, out val));
        }
Esempio n. 8
0
        /// <summary>
        /// Tries the get value.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="procType">Type of the proc.</param>
        /// <param name="val">The val.</param>
        /// <returns></returns>
        public bool TryGetValue(Type type, MappedStatementType procType, out StatementMap val)
        {
            var procName = BuildMappedStatementName(type, procType);

            return(TryGetValue(procName, out val));
        }
Esempio n. 9
0
 /// <summary>
 /// Adds the specified map.
 /// </summary>
 /// <param name="map">The map.</param>
 /// <param name="dbName">Name of the db.</param>
 /// <param name="type">The type.</param>
 /// <param name="body">The body.</param>
 public StatementMap Add(EntityMap map, string dbName, MappedStatementType type, string body)
 {
     return(Add(map, dbName, type, body, Platform.Id));
 }