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 / EmailSendWithScheduledTask.cs
Last active December 18, 2015 13:19
Scheduled Task to send email
namespace Sample.EmailMechanism
{
public class NotificationController
{
public NotificationController() { }
public void Check()
{
NotificationRepository repository = new NotificationRepository();
IEnumerable<NotificationMessage> list = repository.SelectNotification();
@yemrekeskin
yemrekeskin / Processor.cs
Created June 22, 2013 16:29
Processor class for critical jobs in c#
public interface IProcessor
{
void Process();
}
public abstract class BaseProcessor
: IProcessor
{
public delegate void ProcessorStartingEventHandler(params Object[] param);
public delegate void ProcessorStartedEventHandler(params Object[] param);
@yemrekeskin
yemrekeskin / ProcessorJob.cs
Created June 22, 2013 16:31
Job class structure for processor class
public interface IJob
{
object[] Start(Parameters paramList = null);
}
public abstract class BaseJob
: IJob
{
public abstract object[] Start(Parameters paramList = null);
}
@yemrekeskin
yemrekeskin / RuleClasses.cs
Created June 24, 2013 18:33
RuleClasses for Event Based Rule Engine
public delegate void RuleEventHandler(object sender, RuleEventArgs e);
public class RuleEventArgs
: EventArgs
{
public RuleEventArgs()
: base()
{ }
}
@yemrekeskin
yemrekeskin / BaseException.cs
Last active December 19, 2015 02:29
Base Exception for our application
/// <summary>
/// Base Exception when our application
/// </summary>
public class MyApplicationException
: ApplicationException
{
public MyApplicationException()
{
}
using System.Web.Mvc;
namespace CoreMvcApplication
{
public class VideoChannelAreaRegistration
: AreaRegistration
{
public override string AreaName
{
get
@yemrekeskin
yemrekeskin / CommandProcessor.cs
Created July 9, 2013 13:09
Command Processor Class - Command Query Responsibility Separation with Command Processor in asp.net mvc
public class ProductAddHandler
: ICommandHandler<ProductAddCommand>
{
private readonly IProductRepository _productRepository;
public ProductAddHandler(IProductRepository productRepository)
{
this._productRepository = productRepository;
}
public ICommandResult Execute(ProductAddCommand command)
@yemrekeskin
yemrekeskin / adapterDesignPattern.cs
Last active December 19, 2015 18:19
this code snippet is implementation of adapter design pattern with C#
// Target or Wrapper
public interface IPostOperation
{
void AddPost(string head);
}
// util operation class
public class PostOperation
:IPostOperation
{
@yemrekeskin
yemrekeskin / CustomWatcher.cs
Created July 15, 2013 11:52
Enterprise Code #7 : Watching a File or Directory using FileSystemWatcher
public class CustomWatcher
{
private FileSystemWatcher _watcher;
private bool IsWatching;
private StringBuilder strMsg = new StringBuilder();
private bool IncludeSubFolder = false; // SubFolder Check
private bool DirectoryCheck; // Directory // Folder
// !DirectoryCheck // File
@yemrekeskin
yemrekeskin / CompositionDesignPattern.cs
Created July 16, 2013 12:19
Composition Design Pattern
public abstract class Staff
{
protected string Title;
public Staff(string title)
{
this.Title = title;
}
public abstract void Add(Staff staff);