- Recursive Inner Exception Looping for Logging Purpose.
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
declare @json varchar(max) = '[ | |
{ | |
"InvoiceNumber": 3333428, | |
"PaidAmount": 10.0, | |
"Bank": "Bank Name 1", | |
"PaymentReference": "PaymentReference 1" | |
}, | |
{ | |
"InvoiceNumber": 2457759, | |
"PaidAmount": 15.0, |
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
//Path.Combine Equivalent in Javascript | |
function pathJoin(parts, sep){ | |
const separator = sep || '/'; | |
parts = parts.map((part, index)=>{ | |
if (index) { | |
part = part.replace(new RegExp('^' + separator), ''); | |
} | |
if (index !== parts.length - 1) { |
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
public class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Starting Padauk Web API Services"); | |
try | |
{ | |
var applicationName = "Padauk.API"; | |
var builder = WebApplication.CreateBuilder(args); | |
var startup = new WebHostStartup(builder.Configuration); |
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 MailKit.Net.Smtp; | |
using MimeKit; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace HelperUtilities.MailKitNew | |
{ | |
public class MailHelper |
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
[RoutePrefix("")] | |
public class AdminController : ApiController | |
{ | |
[Route("Admin/{id}")] | |
[HttpGet] | |
public IHttpActionResult Admin(string id) | |
{ | |
if ( | |
(ConfigurationManager.AppSettings["LogsKey"] != null && ConfigurationManager.AppSettings.Get("LogsKey") == 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
declare @netprice decimal(18,2) = 120; | |
declare @vatrate decimal(18,2) = 20; | |
DECLARE @baseprice decimal(18,2) | |
SET @baseprice = @netprice / (1 + (@vatrate/100)) | |
select @baseprice as BasePrice, ((@vatrate/100)*(@baseprice)) as Vat , @baseprice + ((@vatrate/100)*(@baseprice)) as NetPrice |
#Windows Command Line Batch Examples
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; | |
namespace CoreApp | |
{ | |
public class CustomLogger | |
{ | |
private static object lockObject = new object(); | |
private string _baseFolderForLogs = string.Empty; | |
private string _baseFileNameForLogs = string.Empty; |
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
//Get Nullable Type | |
namespace TestConsoleApp | |
{ | |
public class PaginationRequestParams | |
{ | |
public string? page_cursor { get; set; } | |
public int? count { get; set; } | |
public string? response_fields { get; set; } |
OlderNewer