Why are we building this?
What do you want to achieve with building this? You can even talk about how this will effect Metrics or KPIs
var controllers = from type in myAssembly.GetTypes() | |
where type.Name.Contains("Controller") | |
where !type.IsAbstract | |
select type; | |
// bunun yerine ITypeLocator kullanabilirsin. | |
// _locator.FindClassesOfType<Controller>(); | |
foreach(var controller in controllers) | |
{ |
# start | |
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist | |
# stop | |
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist |
public interface ICache<T> where T : class | |
{ | |
void Put(object key, T value); | |
T Get(object key); | |
void Update(object key, T value); | |
} | |
public abstract class CacheBase<T> : ICache<T> where T : class | |
{ |
public class UrlGenerator | |
{ | |
private static readonly char[] letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".ToCharArray(); | |
public static string ConvertToUrl(int number) | |
{ | |
try | |
{ | |
string shortenedUrl = string.Empty; |
public class Order | |
{ | |
public int Id { set; get; } | |
public string Customer { set; get; } | |
public PaymentDetails PaymentDetails { set; get; } | |
public List<LineItem> LineItems { set; get; } | |
} | |
public class PaymentDetails | |
{ |
interface CustomerService | |
{ | |
// Queries | |
Customer GetCustomer(int id); | |
IEnumerable<Customer> GetPreferredCustomers(); | |
// Commands | |
void CreateCustomer(Customer customer); | |
void EditCustomer(CustomerDetails customerDetails); |
Item[] GetItems(); | |
IFoo Map(Bar bar); |
interface IMessageProcessor | |
{ | |
public string Process(string message); | |
} |
public static class IEnumerableExtensions | |
{ | |
public static DataTable AsDataTable<T>(this IEnumerable<T> data) | |
{ | |
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T)); | |
var table = new DataTable(); | |
foreach (PropertyDescriptor prop in properties) | |
table.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType); | |
foreach (T item in data) | |
{ |