Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dapper Rainbow - How to specify table name in another schema

I am pretty new to Dapper Rainbow so I may be missing something obvious. Is it possible to specify the table name and if so how?

I have tried the following with no luck.

public class DashboardContext : Database<DashboardContext>
{
    public DashboardContext()
    {
       this.DashboardResults = new Table<DashboardResult>(this, "Monitor.DashboardResult");
    }

    public Table<DashboardResult> DashboardResults { get; set; }
}
like image 291
Andrew Avatar asked Nov 13 '22 22:11

Andrew


1 Answers

I had the same problem but it seems an error in the code. I´ve just commented the lines where is setting the constructor for tables (Database.cs) and it works.

    internal void InitDatabase(DbConnection connection, int commandTimeout)
    {
        this.connection = connection;
        //this.commandTimeout = commandTimeout;
        //if (tableConstructor == null)
        //{
        //    tableConstructor = CreateTableConstructorForTable();
        //}

        //tableConstructor(this as TDatabase);
    }

I guess this is not the best solution...

like image 110
Maxolidean Avatar answered Dec 27 '22 00:12

Maxolidean