Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

TestDataProviderManager.cs

using Nop.Core;
using Nop.Core.Infrastructure;
using Nop.Data;
using Nop.Data.Configuration;
using Nop.Data.DataProviders;

namespace Nop.Tests;

/// 
/// Represents the data provider manager
/// 
public partial class TestDataProviderManager : IDataProviderManager
{
    #region Properties

    /// 
    /// Gets data provider
    /// 
    public INopDataProvider DataProvider
    {
        get
        {
            return Singleton.Instance.DataProvider switch
            {
                DataProviderType.SqlServer => new MsSqlNopDataProvider(),
                DataProviderType.MySql => new MySqlNopDataProvider(),
                DataProviderType.PostgreSQL => new PostgreSqlDataProvider(),
                DataProviderType.Unknown => new SqLiteNopDataProvider(),
                _ => throw new NopException($"Unknown [{Singleton.Instance.DataProvider}] DataProvider")
            };
        }
    }

    #endregion
}