Skip to content

Instantly share code, notes, and snippets.

View k4m4r82's full-sized avatar
🏠
Working from home

Kamarudin k4m4r82

🏠
Working from home
View GitHub Profile
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Load plugin cetak nota..\n");
var loader = new PluginLoader();
loader.LoadPlugins();
foreach (var plugin in PluginLoader.Plugins)
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Dapper.Contrib.Extensions;
using NorthwindApi.Model.Context;
using NorthwindApi.Model.Entity;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace NorthwindApi.Model.Repository
{
public interface IBaseRepository<T>
where T : class
{
Task<int> Save(T obj);
Task<int> Update(T obj);
using Dapper.Contrib.Extensions;
namespace NorthwindApi.Model.Entity
{
[Table("products")]
public class Product
{
[ExplicitKey]
public string product_code { get; set; }
public string product_name { get; set; }
using System;
using System.Data;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using MySql.Data.MySqlClient;
namespace NorthwindApi.Model.Context
{
public interface IDbContext : IDisposable
@k4m4r82
k4m4r82 / postgres_queries_and_commands.sql
Created March 11, 2020 03:22 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@k4m4r82
k4m4r82 / MahasiswaRepository.cs
Created November 27, 2019 08:26
Contoh class MahasiswaRepository
using System;
using System.Collections.Generic;
using System.Data.OleDb;
using PerpustakaanAppMVC.Model.Entity;
using PerpustakaanAppMVC.Model.Context;
namespace PerpustakaanAppMVC.Model.Repository
{
public class MahasiswaRepository
@k4m4r82
k4m4r82 / app.config.json
Created August 2, 2019 06:00
Contoh file konfigurasi aplikasi menggunakan format JSON
{
"server": "192.168.1.1",
"database": "DbOpenRetail",
"port": 5432
}
@k4m4r82
k4m4r82 / app.config.xml
Created August 2, 2019 05:55
Contoh file konfigurasi aplikasi menggunakan format XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="server" value="192.168.1.1" />
<add key="database" value="DbOpenRetail" />
<add key="port" value="5432" />
</appSettings>
</configuration>
@k4m4r82
k4m4r82 / app.config.ini
Created August 2, 2019 05:49
Contoh file konfigurasi aplikasi menggunakan format INI
[database]
server=192.168.1.1
database=DbOpenRetail
port=5432