Git Product home page Git Product logo

dapper.datarepositories's People

Contributors

elninjagaiden avatar yoinbol 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dapper.datarepositories's Issues

Include Table Schema Name

First of all, thanks. You have developed a very useful library. I was trying to access to a table that doesn't have the default schema so the queries fail. I think that adding a property to the StoreAsAttribute like SchemaName and slightly changing the querybuilder would solve it.
Thanks in advance

ExecuteScalar missing

When I add the nuget pacakge for Dapper.DataRepositories I get an error saying the ExecuteScalar is missing.

Reusing Connection Causes Errors

When re-using the same SQL connection for more than one data reader for the same command, the query fails with DataReader already open.

Transaction problem

By default, the current database connection transaction is not passed in, which leads to the need to rewrite the method to pass in the transaction to achieve transaction control
image
Like the InsertAsync method
image

Dependency Updates

Hey man, any chance you can upgrade the deps on Dapper + SqlGenerator to 1.50.2 and 1.0.0.3 respectively. Tried to do a pull request but failed epicly so just thought I would ask here. Shot for the awesome package :

It is recommended to add a SetLimit extension method that supports custom sql

It is recommended to add a SetLimit extension method that supports custom sql
This is the version of sql server used in my project

`public Task<IEnumerable<TEntity>> GetAllPagedAsync(string customSql, int pageNumber, int itemsPerPage, string orderby, object parameters = null, bool buffered = true)
        {
            string pagedListSql = @$"select * from ({customSql}) pagetable ORDER BY {orderby} OFFSET { (pageNumber - 1) * itemsPerPage  } ROWS FETCH NEXT { itemsPerPage} ROWS only ";
            return Connection.QueryAsync<TEntity>(pagedListSql, param: parameters, transaction: ActiveTransaction, commandTimeout: Timeout);
        }`

I use him like this
It should be because I have a very complicated multi-table related query, so I need to support the definition of sql paging query

var sb = new SqlBuilder();
            var builder = sb.AddTemplate(@"select * from (select ROW_NUMBER()over(partition by c.ProcessId order by c.Process_ProcessCode desc) rowId,c.* from(SELECT 
                            ptd.*,
                            p.ProcessCode as Process_ProcessCode,
                            p.ProcessName as Process_ProcessName,
                            p.ProcessDesc as Process_ProcessDesc,
                            p.ProcessNameEnglish,p.ProcessDescEnglish, 
                            p.CarType as Process_CarType,
                            ct.BaseDataValue as Process_CarTypeValue,
                            gv.BaseDataValue as Process_GradeVale,
                            p.SAM as Process_SAM,
                            p.Wages as Process_UnitPrice,
                            p.SingleHourOutput as Process_HourlyOutput,
                            p.CodeType as Process_CodeType,
                            pdt.BaseDataValue as ProductValue,
                            p.grade,p.departmentCode,
                            pat.BaseDataValue as PartValue,dc.BaseDataValue as DepartmentCodeName,p.SourceStyleNumber,ft.FtyCode,ft.FactoryName,p.Description     
                            FROM ProcessTemplateDetail ptd 
                            LEFT JOIN Process p on CONVERT(VARCHAR(50),ptd.ProcessId) = p.Id   
                            left join [dbo].[BaseData] ct on CONVERT(VARCHAR(50),ct.id) = p.cartype   
                            left join [dbo].[BaseData] gv on CONVERT(VARCHAR(50),gv.id) = p.Grade   
                            left join[dbo].[BaseData] pdt on CONVERT(VARCHAR(50),pdt.id) = p.ProductType   
                            left join[dbo].[BaseData] pat on CONVERT(VARCHAR(50),pat.id) = p.PartType   
                            left join[dbo].[BaseData] dc on CONVERT(VARCHAR(50),dc.id) = p.DepartmentCode
                            left join Factory ft on ft.id = p.SourceFactory
                            /**where**/ ) as c) 
                            as AuctionRecords ");

            if (!string.IsNullOrWhiteSpace(query.MenuName))
                sb.Where("ProcessCode like CONCAT('%',@MenuName,'%')", new { query.MenuName });
            if (!string.IsNullOrWhiteSpace(query.Url))
                sb.Where("Url like CONCAT('%',@Url,'%')", new { query.Url });

            var items = await _repository.GetAllPagedAsync(builder.RawSql, query.pageIndex, query.PageSize, query.OrderBy, builder.Parameters);

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.