Skip to content

Instantly share code, notes, and snippets.

View omansak's full-sized avatar
👨‍💻
Code^Game^Sleep > Bermuda Triangle

OMANSAK omansak

👨‍💻
Code^Game^Sleep > Bermuda Triangle
View GitHub Profile
@omansak
omansak / oracle-generate-class-from-table.sql
Last active March 25, 2024 20:11
Oracle DB Generate Class From Table
/*
______________________________________________________________________
| ORACLE DATABASE DATA TYPE | NET TYPE ALIAS | NETDATATYPE |
|----------------------------|----------------|----------------------|
| NUMBER1 | BOOL | SYSTEM.BOOLEAN |
| NUMBER2TONUMBER4 | BYTE | SYSTEM.BYTE |
| NUMBER5 | SHORTINT16 | SYSTEM.INT16 |
| NUMBER6TONUMBER10 | INTINT32 | SYSTEM.INT32 |
| NUMBER11TONUMBER19 | LONGINT64 | SYSTEM.INT64 |
| NUMBERGT19 | DECIMAL | SYSTEM.DECIMAL |
@omansak
omansak / net-core-password-hash.cs
Created October 23, 2021 00:23
.NET Core Password Hash (C#)
public class PasswordHasher
{
/// <summary>
/// Size of salt.
/// </summary>
private const int SaltSize = 16;
/// <summary>
/// Size of hash.
/// </summary>
@omansak
omansak / sqlserver-generate-class-from-table.sql
Last active November 8, 2021 13:45
SQLServer (MSSql) Generate Class From Table
declare @TableName sysname = 'LOGIN'
declare @Result varchar(max) ='[Table("'+@TableName+'")]' +'
public class ' + @TableName + '
{'
select @Result = @Result + ' [Column("'+ replace(ColumnName, ' ', '_') +'")]' +'
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; }
'
from
(
@omansak
omansak / OracleQueryBuilder.cs
Last active February 7, 2020 07:55
Oracle Query Builder writen C# / .NET. (Stored Procedure,Functions,Tables,Queries)
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace MSU.Recourse.Extensions
{
@omansak
omansak / ValueReferenceType.cs
Last active September 4, 2019 09:05
C# Value Type and Reference Type | In C#, these data types are categorized based on how they store their value in the memory (string vs StringBuilder || struct vs class)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
public class Program
{
static void Main(string[] args)