Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="Radischevo.Wahha.Data.DbCommandResult"/> class.
 /// </summary>
 /// <param name="provider">The <see cref="Radischevo.Wahha.Data.IDbDataProvider"/>
 /// instance used to access the database.</param>
 /// <param name="command">The <see cref="Radischevo.Wahha.Data.DbCommandDescriptor"/>
 /// describing the command to execute.</param>
 public DbCommandResult(IDbDataProvider provider, DbCommandDescriptor command)
 {
     Precondition.Require(provider, () => Error.ArgumentNull("provider"));
     _provider = provider;
     _command  = command;
     _behavior = CommandBehavior.Default;
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _db = new DbDataProvider();
     cbxSource.DataSource = _db.GetSources().Select((item) => new ListItem()
     {
         Text = item.Pniv, Value = item.SourceUuid
     });
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Radischevo.Wahha.Data.DbOperationScope"/> class.
        /// </summary>
        /// <param name="provider">The <see cref="Radischevo.Wahha.Data.IDbDataProvider"/>
        /// used to perform database queries.</param>
        public DbOperationScope(IDbDataProvider provider)
            : base()
        {
            Precondition.Require(provider, () =>
                                 Error.ArgumentNull("provider"));

            _provider       = provider;
            _cache          = new ScopedCacheProvider(CacheProvider.Instance);
            _isolationLevel = IsolationLevel.ReadCommitted;
        }
 public OrderingDbDataSeeder(
     ILogger <OrderingDbDataSeeder> logger,
     IExecutionPolicy policy,
     IDbDataProvider <IEnumerable <OrderStatus> > orderStatusDataProvider,
     IDbDataProvider <IEnumerable <CardType> > cardTypesDataProvider)
 {
     _logger = logger;
     _policy = policy;
     _orderStatusDataProvider = orderStatusDataProvider;
     _cardTypesDataProvider   = cardTypesDataProvider;
 }
Esempio n. 5
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or
 /// resetting unmanaged resources.
 /// </summary>
 /// <param name="disposing">A value indicating whether
 /// the disposal is called explicitly.</param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_hasOwnedContext)
         {
             IDisposable disposable = (_provider as IDisposable);
             if (disposable != null)
             {
                 disposable.Dispose();
             }
         }
     }
     _provider = null;
     _cache    = null;
     _disposed = true;
 }
Esempio n. 6
0
        //private string choice;

        public QuestionForm(Student person)
        {
            InitializeComponent();
            Person = person;
            ClearBoxes();
            numTextBox.Text = "1";
            // it takes the string for the provider name and looks for it
            //in the app.config file
            this.dataProvider       = new MySqlDataProvider(new MySqlDatabaseConnection());
            this.questionController = new QuestionController(dataProvider);
            questions = questionController.GetQuestions(Person.Topic);

            /* pager = new Pager()
             * {
             *   PageSize = 1,
             *   ItemCount = questions.Count,
             *   PageIndex = 0
             * };*/
            numQuestions = questions.Count <Question>();
        }
Esempio n. 7
0
 /// <summary>
 /// Creates a <see cref="Radischevo.Wahha.Data.DbCommandResult"/> wrapper for
 /// the specified <paramref name="command"/>.
 /// </summary>
 /// <param name="provider">An instance of data provider being extended.</param>
 /// <param name="command">The object, describing the command to execute.</param>
 public static DbCommandResult Execute(this IDbDataProvider provider, DbCommandDescriptor command)
 {
     Precondition.Require(provider, () => Error.ArgumentNull("provider"));
     return(new DbCommandResult(provider, command));
 }
Esempio n. 8
0
 /// <summary>
 /// Creates a <see cref="System.Data.IDbCommand"/> instance, which is
 /// appropriate for the current provider, using the specified
 /// <paramref name="commandText"/> and <paramref name="parameters" />
 /// and returns a <see cref="Radischevo.Wahha.Data.DbCommandResult"/> wrapper.
 /// </summary>
 /// <param name="provider">An instance of data provider being extended.</param>
 /// <param name="commandText">The text of the query to execute.</param>
 /// <param name="parameters">The object containing command parameters.</param>
 public static DbCommandResult Execute(this IDbDataProvider provider, string commandText, object parameters)
 {
     return(Execute(provider, new DbCommandDescriptor(commandText, CommandType.Text, parameters)));
 }
Esempio n. 9
0
 /// <summary>
 /// Creates a <see cref="System.Data.IDbCommand"/> instance, which is
 /// appropriate for the current provider, using the specified
 /// <paramref name="commandText"/> and returns a
 /// <see cref="Radischevo.Wahha.Data.DbCommandResult"/> wrapper.
 /// </summary>
 /// <param name="provider">An instance of data provider being extended.</param>
 /// <param name="commandText">The text of the query to execute.</param>
 public static DbCommandResult Execute(this IDbDataProvider provider,
                                       string commandText)
 {
     return(Execute(provider, new DbCommandDescriptor(commandText)));
 }
Esempio n. 10
0
 public QuestionController(IDbDataProvider provider)
 {
     this.provider = provider;
 }
Esempio n. 11
0
 public ReadOnlyRepository(IDbDataProvider dataProvider)
 {
     this.context = dataProvider.AsQueryable <T>();
 }
		/// <summary>
		/// When overridden in a derived class, disposes the specified 
		/// <see cref="Radischevo.Wahha.Data.IDbDataProvider"/>.
		/// </summary>
		/// <param name="provider">The provider instance to dispose.</param>
        public virtual void DisposeProvider(IDbDataProvider provider)
        {
            Precondition.Require(provider, () => Error.ArgumentNull("provider"));
            provider.Dispose();
        }
Esempio n. 13
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="Radischevo.Wahha.Data.DbCommandResult"/> class.
 /// </summary>
 /// <param name="provider">The <see cref="Radischevo.Wahha.Data.IDbDataProvider"/>
 /// instance used to access the database.</param>
 public DbCommandResult(IDbDataProvider provider)
     : this(provider, null)
 {
 }
Esempio n. 14
0
 public HostingCore(IDbDataProvider dbDataProvider)
 {
     _dbDataProvider = dbDataProvider;
 }
 /// <summary>
 /// When overridden in a derived class, disposes the specified
 /// <see cref="Radischevo.Wahha.Data.IDbDataProvider"/>.
 /// </summary>
 /// <param name="provider">The provider instance to dispose.</param>
 public virtual void DisposeProvider(IDbDataProvider provider)
 {
     Precondition.Require(provider, () => Error.ArgumentNull("provider"));
     provider.Dispose();
 }
Esempio n. 16
0
 public Repository(IDbDataProvider dataProvider)
 {
     this.context    = dataProvider.GetDbSet <T>();
     this.unitOfWork = dataProvider;
 }
Esempio n. 17
0
        public DataSeederBuilder <TDbContext> AddDbDataProvider <TData>(IDbDataProvider <TData> dataProvider)
        {
            _builder.Services.AddSingleton(dataProvider);

            return(this);
        }