Git Product home page Git Product logo

dapper-rainbow-mysql's People

Contributors

antonheryanto avatar kiriranshero avatar robbert229 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dapper-rainbow-mysql's Issues

Dynamic table generation.

Would adding in dynamic table generation be a bad idea? I have already completed most of this but I am wondering if it is okay for me to continue to make pull requests.

another issue about class:Table<T, TId>

when i make a property with type: Table<T, TId> in Database...I found that can't work.. the Table<T,TId> property of Database will be null at runtime....
Is the model key can't be other type except long?

你好我想用工厂的方式去操作数据库 但是如何释放数据库链接呢?

采用这种方式进行数据库操作:
每次CRUD都会创建1个新的数据库链接 然后不能释放 一会儿就好几百个数据库链接了
改怎么改造呢?
public class DbContextFactory
{
public static DbContext GetDb(string connString)
{
DbConnection connection = new SqlConnection(connString);
if (connection.State != System.Data.ConnectionState.Open)
connection.Open();
DbContext dbContext = DbContext.Init(connection, 60);
return dbContext;
}
public static DbContext Default
{
get { return GetDb(Config.connString); }
}
}

Framework 4.0

I need install on Windows XP and I need complile in framework 4.0 fot this.

Dapper is able.
Is able the Rainbow?

thanks

InsertOrUpdate not return id

When I use the InsertOrUpdate function of the Rainbow, it returns 1 when it inserts and 2 when it updates. How can I get the id of the object that has been updated or inserted?

I have the version of dapper 1.50.2 and of Rainbow.MySql 0.10.1

Code:

public static Tuple<int, int> AddOrUpdateSesionCarrera(sesiones sesion, out Pk15Error pk15error)
        {
            pk15error = new Pk15Error();
            try
            {
                using (var transaction = new TransactionScope())
                {
                    // Operaciones sobre la base de datos.
                    Db newdb = IVS_OpenConnection.db;
                    OpenConnectionInstance connect = null;
                    if (!string.IsNullOrEmpty(IVS_OpenConnection.CadenaConexion))
                    {
                        connect = new OpenConnectionInstance(IVS_OpenConnection.CadenaConexion);
                        newdb = connect.db;
                    }

                    if (sesion.carrera != null)  
                    {
                        var sesionId = newdb.Sesiones.InsertOrUpdate(sesion); //TODO InsertOrUpdate not return id.
                        sesion.carrera.idSesion = (int)sesionId;
                        var carreraId = newdb.Carrera.InsertOrUpdate(sesion.carrera);
                        connect?.Dispose();
                        /* Devolvemos el id de la sesion */
                        return new Tuple<int, int>((int)sesionId, (int)carreraId);
                    }

                    // Aceptamos la transacción.
                    transaction.Complete();
                }
            }
            catch (OpenConexionDbException e)
            {
                pk15error.exception = e;
                pk15error.errorType = EnumeradosIVS.TDapperError.DatabaseConnection;
                return null;
            }
            catch (Exception e)
            {
                pk15error.exception = e;
                pk15error.errorType = EnumeradosIVS.TDapperError.DatabaseQuery;
                error.EscribeErrorBD("Error AddSesionCarrera: " + e.Message);
                throw new Exception("Error AddSesionCarrera: " + e.Message);
            }
            return null;
        }

Thank you @antonheryanto

an error of method:Page<T>

when i use the method by sql with "order by" .. there will be throw an exception...
to debug the source.. then i have to change the code line of Page.cs:

var sqlCount = string.Format ("{0} COUNT({1}) {2}", sql.Substring (0, g.Index), count, sql.Substring (g.Index + g.Length));

to be this:

var sqlCount = string.Format ("{0} COUNT({1}) from ({2}) as {3} ", sql.Substring (0, g.Index), count, sql, new Guid().ToString());

can you update this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.