Skip to content

Instantly share code, notes, and snippets.

View ArseniySavin's full-sized avatar
😏

savars ArseniySavin

😏
View GitHub Profile
@vijayganeshpk
vijayganeshpk / OracleDynamicParameters.cs
Last active February 8, 2024 09:04
OracleDynamicParameters class for Dapper
using Dapper;
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters {
private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>( );
public class SomeClass {
public void SomeMethod() {
this.Log().Info(() => "Here is a log message with params which can be in Razor Views as well: '{0}'".FormatWith(typeof(SomeClass).Name));
}
}
@miguelmota
miguelmota / insert.go
Last active May 28, 2024 15:34
Golang SQL insert row and get returning ID example
func InsertOrder(order *Order) (int, error) {
var id int
tx, err := db.Begin()
if err != nil {
return id, err
}
{