dapper-extensions

Dapper Extension Ms Access System.Data.OleDb.OleDbException

浪尽此生 提交于 2019-11-29 12:52:07
I just started to use Dapper. Dapper works fine. As a next step when I tried to integrate with Dapper Extension. It generates an exception called System.Data.OleDb.OleDbException "Additional information: Characters found after end of SQL statement." Why is that? Dapper Extension doesn't support Ms Access (because of the end character) or problem with my code or I am missing something. My code is below using (var conn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=myAccessFile.accdb;")) { conn.Open(); conn.Insert<Person>(new Person { Name = "John Stan", Age = 20 }); }

Ignore property on model property

流过昼夜 提交于 2019-11-28 06:58:40
问题 How can I ignore a property on my model using dapper/dapper extensions/dapper rainbow or any of those dapper libraries? 回答1: Dapper creator Sam Saffron has addressed this requirement in response to another SO user's questions here. Check it out. Also, if you want to use the Dapper Extensions library that Sam has mentioned in his answer, you can get it from Github or via Nuget. Here's an example of ignoring properties from the Library's Test Project. using System; using System.Collections

How to log/get a SQL query auto-generated by Dapper Extensions?

倖福魔咒の 提交于 2019-11-27 14:50:47
I am using Dapper Extensions (DE) as ORM. It is consumed in Data Access Layer which is implemented using Repository pattern. SQL Express is back-end RDBMS. DE automatically generates most of the queries for me. I want to log those auto-generated queries for debugging purpose. There are two ways I can see to achieve this: - Get the SQL query generated by DE (before or after it is executed) and write it to log. This is preferred way for me as I already have my logging module (using log4net) in place. The only thing I need is the SQL generated by DE. Integrate DE with some logging tool. I read

How to log/get a SQL query auto-generated by Dapper Extensions?

纵然是瞬间 提交于 2019-11-26 14:34:51
问题 I am using Dapper Extensions (DE) as ORM. It is consumed in Data Access Layer which is implemented using Repository pattern. SQL Express is back-end RDBMS. DE automatically generates most of the queries for me. I want to log those auto-generated queries for debugging purpose. There are two ways I can see to achieve this: - Get the SQL query generated by DE (before or after it is executed) and write it to log. This is preferred way for me as I already have my logging module (using log4net) in