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
data:text/html;charset=utf-8,<title>TextEditor<%2Ftitle><style>body.dark-mode%2Cbody.dark-mode%20*%7Bbackground-color%3A%23111%3Bcolor%3A%23eee%7Dbody.light-mode%2Cbody.light-mode%20*%7Bbackground-color%3A%23eee%3Bcolor%3A%23111%7Dbody%7Bmargin%3A0%20auto%3Bwidth%3A50rem%7Dtextarea%7Bborder%3A0%3Bfont-family%3Asans-serif%3Bfont-size%3A1rem%3Bheight%3A98%25%3Bline-height%3A1.3%3Bmargin%3A0%20auto%3Boutline%3A0%3Bpadding%3A3rem%3Bwidth%3A100%25%7Dbutton%7Bmin-height%3A30px%3Bbackground-color%3A%23fbfbfb%3Bborder%3A1px%20%23ccc%20solid%3Bcolor%3A%23999%3Bcursor%3Apointer%3Bfloat%3Aright%3Bmargin%3A10px%200%3Bpadding%3A5px%2010px%7D@media%20%28max-width%3A768px%29%7Bbody%7Bwidth%3A100%25%3Bpadding%3A0%7Dtextarea%7Bpadding%3A10px%7Dbutton%7Bfloat%3Anone%7D%7D<%2Fstyle><body%20id%3Dbody%20class=light-mode><button%20type%3D"button"%20onclick%3D"tDL%28%29"%20title%3D"Toggle%20dark%2Flight%20mode">🌛<%2Fbutton><button%20onclick%3D"sM%28%29%3B%20return%20false">Email%20this<%2Fbutton><textarea%20contenteditable%20id%3DT |
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 EnumValidation : ValidationAttribute | |
{ | |
protected override ValidationResult IsValid(object value, ValidationContext validationContext) | |
{ | |
if (value != null) | |
{ | |
if (!string.IsNullOrWhiteSpace(Convert.ToString(value))) | |
{ | |
var type = value.GetType(); | |
if (!(type.IsEnum && Enum.IsDefined(type, value))) |
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 Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Options; | |
using System; | |
using System.IO; | |
using System.Net; | |
using System.Net.Mail; | |
using System.Net.Security; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Threading.Tasks; |
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
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# User-specific files | |
*.suo | |
*.user | |
*.userosscache | |
*.sln.docstates | |
# User-specific files (MonoDevelop/Xamarin Studio) |
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
# User-specific files | |
*.suo | |
*.user | |
*.sln.docstates | |
# Build results | |
bin | |
obj | |
logs | |
dist |
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
#@echo off | |
#title Publish | |
#Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass | |
Write-Output ("IIS attempts to stop all services.") | |
iisreset /stop | |
Write-Output ("Publish Starting...") | |
Write-Output ("Project publish start...") | |
dotnet publish "src\Project.csproj" -c Release -o D:\Publish\Project |
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
#@echo off | |
cls | |
#title Publish | |
echo [32m IIS attempts to stop all services.[0m | |
iisreset /stop | |
echo [32m Publish Starting...[0m | |
echo [36m Project publish start...[0m | |
dotnet publish "src\Project.csproj" -c Release -o D:\Publish\Project |
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
@echo off | |
@echo Deleting all BIN and OBJ folders... | |
for /d /r . %%d in (bin,obj,logs) do @if exist "%%d" rd /s/q "%%d" | |
@echo BIN, OBJ and logs folders successfully deleted :) Close the window. | |
pause > nul |
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 static class PropertyCopier<TParent, TChild> where TParent : class where TChild : class | |
{ | |
public static void Copy(TParent parent, TChild child) | |
{ | |
var parentProperties = parent.GetType().GetProperties(); | |
var childProperties = child.GetType().GetProperties(); | |
foreach (var parentProperty in parentProperties) | |
{ | |
foreach (var childProperty in childProperties) |
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 @TableName sysname = 'Document' | |
declare @Result varchar(max) = 'public class ' + @TableName + ' | |
{' | |
select @Result = @Result + ' | |
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; } | |
' | |
from | |
( | |
select |
NewerOlder