This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Select the DB you wish the db login & user to be applied for | |
USE HelloWebDB | |
GO | |
--Create the login | |
CREATE LOGIN appuser_admin | |
WITH PASSWORD = '@Underworld30' | |
GO | |
--Create user for login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public class TaskParallelAsyncSample | |
{ | |
//Method untuk reverse text. Method ini hanyalah sample untuk demo task dengan nilai kembalian | |
private string ReverseText(string jobName, int sleepTime, string text) | |
{ | |
Console.WriteLine($">> {jobName} has started the job"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public class TaskParallelSample | |
{ | |
//Ini adalah method fiksi yang diibaratkan workload yang akan dipanggil oleh invoker | |
//Method ini mendemokan proses kerja yang lama | |
private void ExecJob(string jobName, int sleepTime) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace GarudaAPICore.Helpers | |
{ | |
public class BatchProcess<T> | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using YoutubeExplode; | |
using YoutubeExplode.Models; | |
using YoutubeExplode.Models.MediaStreams; | |
namespace YoutubeDownloader | |
{ | |
class Program | |
{ | |
static async void Start(string id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
using MirzaCryptoHelpers.Common; | |
using MirzaCryptoHelpers.Hashings; | |
using MirzaCryptoHelpers.SymmetricCryptos; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
namespace JsonCollection | |
{ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
public class IPAddressInvoke | |
{ | |
//Secara default sourceUrl akan mengarah ke http://whatismyip.host/ | |
//Tetapi bisa di-modify karena nilai tersebut hanyalah default parameter. | |
//Method dibawah menggunakan teknik Asynchronous sehingga apabila return timenya | |
//lama tidak akan membuat program hang | |
public async Task<string> GetExternalIPAddress(string sourceUrl = "http://whatismyip.host/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; | |
public class IOTraversalHelper | |
{ | |
public event Action<string> OnLogError; | |
public IEnumerable<string> TraverseFiles(string path) | |
{ | |
Queue<string> directories = new Queue<string>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Xml.Serialization; | |
namespace XmlserializerTest | |
{ | |
[Serializable] //Attribute yang menandakan bahwa kelas bisa di serialize | |
public class Employee | |
{ | |
public Guid ID { get; set; } = Guid.NewGuid(); | |
public string FirstName { get; set; } |
NewerOlder