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 class ExceptionConverter<TExceptionType> : JsonConverter<TExceptionType> where TExceptionType : Exception | |
{ | |
public override bool CanConvert(Type typeToConvert) => typeof(Exception).IsAssignableFrom(typeToConvert); | |
public override TExceptionType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | |
=> throw new NotSupportedException("Deserializing exceptions is not allowed"); | |
public override void Write(Utf8JsonWriter writer, TExceptionType value, JsonSerializerOptions options) | |
{ | |
var serializableProperties = value.GetType() |
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
/* | |
Navicat SQL Server Data Transfer | |
Source Server : SqlServer_MesutTalebi | |
Source Server Version : 105000 | |
Target Server Type : SQL Server | |
Target Server Version : 105000 | |
File Encoding : 65001 |
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
/* | |
Navicat SQL Server Data Transfer | |
Source Server : SqlServer_MesutTalebi | |
Source Server Version : 105000 | |
Target Server Type : SQL Server | |
Target Server Version : 105000 | |
File Encoding : 65001 |
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
/* | |
Source Server : SqlServer_MesutTalebi | |
Source Server Version : 105000 | |
Target Server Type : SQL Server | |
Target Server Version : 105000 | |
File Encoding : 65001 | |
Date: 2014-07-17 16:09:37 | |
*/ |
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
param ( | |
[string]$blueSiteName = "testblue.mydomain.com", | |
[string]$greenSiteName = "testgreen.mydomain.com", | |
[string]$ipAddress = "192.168.1.108", | |
[int]$httpPort = 80, | |
[int]$httpsPort = 443, | |
[string]$certificateThumbprint = "20437383726bb2e609619ee345825c4854ab0598", | |
[string]$certificateStore = "My" | |
) |
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
param ( | |
[string]$blueSiteName = "testblue.mydomain.com", | |
[string]$greenSiteName = "testgreen.mydomain.com", | |
[string]$ipAddress = "192.168.1.108", | |
[int]$httpPort = 80, | |
[int]$httpsPort = 443, | |
[string]$certificateThumbprint = "20437383726bb2e609619ee345825c4854ab0598", | |
[string]$certificateStore = "My" | |
) |
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
<html> | |
<body> | |
UP - Blue | |
</body> | |
</html> |
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 PredicateBuilder | |
{ | |
public static Expression<Func<T, bool>> True<T>() { return f => true; } | |
public static Expression<Func<T, bool>> False<T>() { return f => false; } | |
public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr1, | |
Expression<Func<T, bool>> expr2) | |
{ | |
var invokedExpr = Expression.Invoke(expr2, expr1.Parameters.Cast<Expression>()); | |
return Expression.Lambda<Func<T, bool>> |
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 class TransactionService : ITransactionService | |
{ | |
private IDbContextTransaction _transaction; | |
private readonly IUnitOfWork _unitOfWork; | |
private Queue _transactions; | |
public TransactionService(IUnitOfWork unitOfWork) | |
{ | |
_unitOfWork = unitOfWork; | |
_transactions = new Queue(); |
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 virtual T GetByIdNoTracking(params object[] id) | |
{ | |
_context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; | |
var item = DbSet.Find(id); | |
if (item != null) | |
if (typeof(ISoftDeleteEnabled).IsAssignableFrom(typeof(T))) | |
item = (bool)typeof(T).GetProperty("IsDeleted").GetValue(item) == false ? item : null; | |
_context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll; |
NewerOlder