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 / CreditCardNumberExtention.cs
Created May 11, 2013 18:44
Enterprise Code #1: Validation for Credit Card Numbers
/// <summary>
/// Validation provider by luhn Algorithm
/// </summary>
public static class CreditCardNumberExtention
{
public const int DIGIT_NUM = 16;
public static bool IsValidCreditCardNumber(this string accountNumber)
{
if (String.IsNullOrEmpty(accountNumber))
@yemrekeskin
yemrekeskin / FtpClient.cs
Created May 14, 2013 19:22
Ftp Client - for FTP Server Connections (creating,transfer for cases)
public interface IFtpConnect
{
string[] GetFiles();
long GetFileSize();
void DownloadFile(string path);
bool DeleteFile();
void UploadFile(string path);
}
public static class Bootstrapper
@yemrekeskin
yemrekeskin / ObjectMapper.cs
Last active September 11, 2022 12:36
using Automapper vs Custom Object Mapper(with reflection) for data transformation of objects
public class BaseModel
{
public Guid Id { get; set; }
public DateTime CreateDate { get; set; }
public bool IsActive { get; set; }
public string LastUpdatingUserName { get; set; }
public DateTime LastUpdatingDate { get; set; }
}
@yemrekeskin
yemrekeskin / LayerLevelLogging.cs
Created May 20, 2013 17:42
Layer Level Logging
/// <summary>
/// possible layers
/// </summary>
public abstract class LayerDefinitions
{
public static string ServiceHostLayer { get { return "Sample.Service.Host"; } }
public static string ServiceRepositorylayer { get { return "Sample.Service.Repository"; } }
public static string CommonRepositorylayer { get { return "Sample.Common.Repository"; } }
public static string DataAccessLayer { get { return "Sample.DataAccess"; } }
public static string WebSecurityLayer { get { return "Sample.WebSecurity"; } }
@yemrekeskin
yemrekeskin / Data Access Object.cs
Created June 6, 2013 13:06
Practices about Data Access Object Pattern
public class Account
{
// set fields and properties
}
public class Customer
{
// set fields and properties
}
using System;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
public class WebsiteThumbImage
{
public int ThumbWidth { get; set; }
public int ThumbHeight { get; set; }
@yemrekeskin
yemrekeskin / DataFormates.cs
Created June 12, 2013 11:31
Object Convert To Other Data Format ( JSON, XML, Binary )
// Object Structure
[Serializable]
public class BasePerson
{
public string SerialNo { get; set; }
public Guid IdNo { get; set; }
}
[Serializable]
@yemrekeskin
yemrekeskin / WebServiceExtention.cs
Created June 13, 2013 20:19
Extention method for web service url address
public static class WebServiceExtention
{
public static bool isValidWebServiceUrl(this string url)
{
bool rv = true;
if (String.IsNullOrEmpty(url))
rv = false;
string Http_URL = HttpUtility.UrlDecode(url);
@yemrekeskin
yemrekeskin / isWebServiceRunning.cs
Created June 15, 2013 09:35
Checking WebServices running status
public static class WebServiceExtention
{
public static bool isWebServiceRunning(this string url)
{
if (String.IsNullOrEmpty(url))
throw new ArgumentNullException();
try
{
var request = (HttpWebRequest)WebRequest.Create(url);
@yemrekeskin
yemrekeskin / WebServiceTestAutomation.cs
Created June 15, 2013 11:08
test automation for web service
public class Scheduler
{
public Scheduler() { }
public void Scheduler_Start()
{
TimerCallback callbackMinute = new TimerCallback(Jobs.WebServiceCheckJob);
Timer minuteTimer = new Timer(callbackMinute, null, TimeSpan.Zero, TimeSpan.FromSeconds(10.0));
}
}