Skip to content

Instantly share code, notes, and snippets.

View yemrekeskin's full-sized avatar
🎯
Focusing

yunus emre keskin yemrekeskin

🎯
Focusing
View GitHub Profile
@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;
public interface IModel
{
private Guid uniqueId;
public Guid UniqueId
{
get { return uniqueId; }
set { value = Guid.NewGuid(); }
}
}
-- 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,
// 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");
}
@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;
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 / 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
// 1 Way
public class Configuration
{
public string EndPoint
{
get { return ConfigurationManager.AppSettings["EndPoint"]; }
}
// other properties here//
}
@yemrekeskin
yemrekeskin / FluentTestProcessor.cs
Last active August 29, 2015 13:56
FluentTestProcessor - code sample for Fluent Interface
public class TestProcessorOutput
{
public string ScreenTestOutputMessage { get; set; }
public string StoredProcedureTestOutputMessage { get; set; }
public string RunOutPutFileValidationTestOutputMessage { get; set; }
public string RunInputFilevalidationTestOutputMessage { get; set; }
}
public interface ITestProcessor
{
-- Veritabanı nesne içerikleri
SELECT * FROM sys.syscomments(NOLOCK)
-- Şema isimlerinin tutulduğu tablo
SELECT * FROM sys.schemas(NOLOCK)
-- Bütün veritabanı nesne isimleri
SELECT * FROM sys.all_objects(NOLOCK)
-- ana select ifadesi