Skip to content

Instantly share code, notes, and snippets.

View yemrekeskin's full-sized avatar
🎯
Focusing

yunus emre keskin yemrekeskin

🎯
Focusing
View GitHub Profile
// 1 Way
public class Configuration
{
public string EndPoint
{
get { return ConfigurationManager.AppSettings["EndPoint"]; }
}
// other properties here//
}
@yemrekeskin
yemrekeskin / LinkCrawler.cs
Created February 11, 2014 21:08
Sample for WebCrawler
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace LinkCrawler
public static class TryCatchExtension
{
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static void WithTryCatch(this Object theClass, Action theMethod)
{
try
{
theMethod.Invoke();
}
@yemrekeskin
yemrekeskin / GenericNotifierJobExecuter.cs
Created January 21, 2014 14:41
Generic Notifier Job Executor class written C# with Quartz.NET
public abstract class BaseNotifierJobExecuter<TJob>
: INotifierJobExecuter
where TJob : IJob
{
private ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
public IScheduler scheduler = null;
protected IJob jobAction = null;
protected string CronExpression = String.Empty;
protected string jobKey = String.Empty;
// nuget package http://www.nuget.org/packages/Quartz/
// http://www.quartz-scheduler.net/
public class SampleJob
: IJob
{
public void Execute(IJobExecutionContext context)
{
Console.WriteLine("OK");
}
-- Açık olan transactionları listeler
SELECT L.request_session_id AS SPID,
DB_NAME(L.resource_database_id) AS DatabaseName,
O.Name AS LockedObjectName,
P.object_id AS LockedObjectId,
L.resource_type AS LockedResource,
L.request_mode AS LockType,
ST.text AS SqlStatementText,
ES.login_name AS LoginName,
public interface IModel
{
private Guid uniqueId;
public Guid UniqueId
{
get { return uniqueId; }
set { value = Guid.NewGuid(); }
}
}
@yemrekeskin
yemrekeskin / Sample2.TemplateMethod.cs
Last active January 2, 2016 11:49
Sample 2 : Template Method Design Pattern
class Program
{
static void Main(string[] args)
{
BaseProcessor reportProcessor = null;
reportProcessor = new ImportReportProcessor();
reportProcessor.ProcessorCompleted += reportProcessor_ProcessorCompleted;
reportProcessor.ProcessorStarting += reportProcessor_ProcessorStarting;
reportProcessor.ProcessorStarted += reportProcessor_ProcessorStarted;
@yemrekeskin
yemrekeskin / Sample.TemplateMethod.cs
Created January 6, 2014 13:03
Sample Template Method Design Pattern
class Program
{
static void Main(string[] args)
{
BaseProcessor reportProcessor = new ReportProcessor();
reportProcessor.ProcessorCompleted += reportProcessor_ProcessorCompleted;
reportProcessor.ProcessorStarting += reportProcessor_ProcessorStarting;
reportProcessor.ProcessorStarted += reportProcessor_ProcessorStarted;
@yemrekeskin
yemrekeskin / PagedList.cs
Created November 10, 2013 18:42
PagedList
class Program
{
static void Main(string[] args)
{
var productOperation = new ProductOperation();
var list1 = productOperation.GetPagedProductList(1, 5);
foreach (var item in list1)
Console.WriteLine(item.Id + " - " + item.Name);