protected DapperContext(DapperContextOptions pDapperContextOptions)
        {
            if (pDapperContextOptions.Extensions.TryGetValue(typeof(SqlConnectionStringBuilder), out var xConnectionStringBuilder))
            {
                _connectionStringBuilder = xConnectionStringBuilder;
            }
            else
            {
                throw new ArgumentException(nameof(_connectionStringBuilder) + " não foi encontrado");
            }


            foreach (var xDapperDbSet in GetType().GetProperties().Where(p => p.PropertyType.BaseType == typeof(DapperDbSet)))
            {
                xDapperDbSet.SetValue(this, Activator.CreateInstance(xDapperDbSet.PropertyType, this));
            }
        }
 public DapperContextOptionsBuilder(DapperContextOptions pDapperContextOptions) : base(pDapperContextOptions)
 {
 }
Beispiel #3
0
 public DapperContextOptionsBuilder(DapperContextOptions pDapperContextOptions)
 {
     DapperContextOptions = pDapperContextOptions;
 }