Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlHelper&lt;P&gt;"/> class.
        /// </summary>
        /// <param name="connectionString">The connection string, cannot be <c>null</c>.</param>
        /// <param name="utility">The utility, a default utility will be used if <c>null</c>.</param>
        public SqlHelper(string connectionString, IUtilitySet utility)
        {
            // Check arguments
            if (connectionString == null)
            {
                throw new ArgumentNullException("connectionString");
            }
            if (utility == null)
            {
                utility = new DefaultUtility <SqlHelper <P> >(this);
            }

            // Initialize member fields
            m_ConnectionString = connectionString;
            m_Utility          = utility;

            #if DEBUG && DebugDataLayer
            // Log creation
            Trace.TraceInformation(GetType().Name + " created.");
            #endif
        }
Example #2
0
 public bool TryDefault(Type type, out IComponent component)
 {
     component = DefaultUtility.Default(type) as IComponent;
     return(component != null);
 }
 internal ExpressionCallContext()
 {
     Utility = new DefaultUtility {
         _context = this
     };
 }
Example #4
0
 public T Default <T>() where T : struct, IComponent => DefaultUtility.Default <T>();