elninjagaiden / dapper.datarepositories Goto Github PK
View Code? Open in Web Editor NEWBase structures to implement Data Repository pattern upon Dapper as MicroOrm.
Base structures to implement Data Repository pattern upon Dapper as MicroOrm.
When I add the nuget pacakge for Dapper.DataRepositories I get an error saying the ExecuteScalar is missing.
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
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 :
Hi, I am using this in an ASP.NET MVC project , and looking for transaction based insertion and updation , can you please explain.
Can you please sign the assembly so that it can be deployed to GAC
When re-using the same SQL connection for more than one data reader for the same command, the query fails with DataReader already open.
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);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.