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 PagedListConverter<TSource,TDestination> : ITypeConverter<PagedList<TSource>, PagedList<TDestination>> | |
{ | |
public PagedList<TDestination> Convert(PagedList<TSource> source, PagedList<TDestination> destination, ResolutionContext context) | |
{ | |
var config = new MapperConfiguration(cfg => { | |
cfg.CreateMap<TSource, TDestination>(); | |
}); | |
IMapper mapper = config.CreateMapper(); | |
var viewModels = source.Select(p => mapper.Map<TSource, TDestination>(p)).ToList(); | |
return new PagedList<TDestination>(viewModels, source.PageIndex, source.PageSize); |
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
SELECT execquery.last_execution_time AS [Date Time], execsql.TEXT as [Script] FROM sys.dm_exec_query_stats as execquery | |
CROSS APPLY sys.dm_exec_sql_text(execquery.sql_handle) AS execsql ORDER BY execquery.last_execution_time DESC |
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.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.HttpsPolicy; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Versioning; | |
using Microsoft.Extensions.Configuration; |
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
class Program | |
{ | |
const int limit = 300000; | |
static void Main(string[] args) | |
{ | |
var plusOperatorResult = WithPlusOperator(); | |
var stringBuildeResult = WithStringBuilder(); | |
Console.WriteLine("Plus Operator Result : " + plusOperatorResult); | |
Console.WriteLine("String Builder Result : " + stringBuildeResult); |
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
class Program | |
{ | |
public const int limit = 5000000; | |
static void Main(string[] args) | |
{ | |
var arrayListResult = WithArrayList(); | |
var listResult = WithList(); | |
Console.WriteLine("Array List sonucu : {0}",arrayListResult); | |
Console.WriteLine("List sonucu : {0}",listResult); |
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.Diagnostics; | |
namespace BoxingUnboxing | |
{ | |
class Program | |
{ | |
const int listSize = 1000000; | |
static void Main(string[] args) | |
{ |
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
node { | |
def app | |
def COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger'] | |
try{ | |
stage('Clone repository') { | |
/* Let's make sure we have the repository cloned to our workspace */ | |
checkout scm | |
} | |
stage('Build image') { | |
/* This builds the actual image; synonymous to |
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 UrlRewriteService : IUrlRewriteService | |
{ | |
#region Fields | |
private readonly IRepository<UrlRewriteRecord> _urlRepository; | |
#endregion | |
#region Ctor |
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 interface IUrlRewriteService | |
{ | |
UrlRewriteRecord GetUrlRewriteRecordByOldUrl(string oldUrl); | |
IList<UrlRewriteRecord> GetAllUrlRewriteRecords(); | |
void InsertUrlRewriteRecords(UrlRewriteRecord urlRewriteRecord); | |
void UpdateUrlRewriteRecords(UrlRewriteRecord urlRewriteRecord); | |
void DeleteUrlRewriteRecords(UrlRewriteRecord urlRewriteRecord); | |
} |
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
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] | |
public class RedirectionAttribute : Attribute, IAsyncActionFilter | |
{ | |
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) | |
{ | |
var urlService = context.HttpContext.RequestServices.GetRequiredService<IUrlRewriteService>(); | |
var siteBaseUrl = "http://www.siteadiniz.com/" | |
var requestedUrl = context.HttpContext.Request.Path.Value.ToString().ToLower(); | |
var url = urlService.GetUrlRewriteRecordByOldUrl(requestedUrl); |