This file contains 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
-------------------------------------------------------------------------------- | |
-- Example JSON_QUERY JSON_VALUE | |
-------------------------------------------------------------------------------- | |
DECLARE @data VARCHAR(4000) | |
SET @data=N'[ | |
{ | |
"Name": "Yoda", | |
"Id": "001" | |
}, | |
{ |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<location path="." inheritInChildApplications="false"> | |
<system.webServer> | |
<handlers> | |
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> | |
</handlers> | |
<aspNetCore processPath=".\WebApp1.exe" | |
stdoutLogEnabled="false" | |
stdoutLogFile=".\logs\stdout" |
This file contains 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
--Add time to date SQL Server | |
-------------------------------------------------------------- | |
DECLARE @Hour TIME = '20:00', | |
@Today VARCHAR(10) = CONVERT(VARCHAR(10), GETDATE(), 121) | |
DECLARE @TodayWithHourString VARCHAR(100) = CONCAT(@Today, ' ', @Hour) | |
DECLARE @TodayWithHour DATETIME2(0) = CONVERT(DATETIME2(0), @TodayWithHourString) | |
SELECT |
This file contains 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
var inicio = new DateTime(2022, 12, 18); | |
var fin = new DateTime(2023, 5, 1); | |
var dias = Enumerable.Range(0, 1 + fin.Subtract(inicio).Days) | |
.Select(offset => inicio.AddDays(offset)) | |
.ToArray(); | |
var diasSinDomingo = Enumerable.Range(0, 1 + fin.Subtract(inicio).Days) | |
.Where(offset => (inicio.AddDays(offset)).DayOfWeek != DayOfWeek.Sunday) |
This file contains 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
Console.WriteLine("Send email with MimeKit + MailKit!"); | |
var from = new MailboxAddress(name: "Demo From", address: "...@outlook.com"); | |
var to = new MailboxAddress(name: "Demo To", address: "...@gmail.com"); | |
var msj = new MimeMessage(); | |
msj.From.Add(from); | |
msj.To.Add(to); | |
msj.Subject = "Episode IV"; |
This file contains 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.Text.RegularExpressions; | |
using System.Linq; | |
using System.Numerics; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var longNumberString = "123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789"; |
This file contains 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 static class TimeSpanExtensions | |
{ | |
public static bool IsBetween(this TimeSpan target, TimeSpan start, TimeSpan end) | |
{ | |
if (target == start) return true; | |
if (target == end) return true; | |
if (start <= end) | |
return (target >= start && target <= end); | |
else |
nuget locals all -list
nuget locals all -clear
NewerOlder