View DemoPlugin.cs
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) |
View ProductRepository.cs
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; |
View IBaseRepository.cs
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); |
View Product.cs
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; } |
View DbContext.cs
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 |
View postgres_queries_and_commands.sql
-- 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%' |
View MahasiswaRepository.cs
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 |
View app.config.json
{ | |
"server": "192.168.1.1", | |
"database": "DbOpenRetail", | |
"port": 5432 | |
} |
View app.config.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> |
View app.config.ini
[database] | |
server=192.168.1.1 | |
database=DbOpenRetail | |
port=5432 |
NewerOlder