This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Entity | |
{ | |
public int Id { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IMessageSerializer<T> where T : class | |
{ | |
string Serialize(T message); | |
byte[] SerializeBytes(T message); | |
T Deserialize(string message); | |
T Deserialize(byte[] message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
public static class TimeSpanExtensions | |
{ | |
/// <summary> | |
/// Returns a string containing the human readable version of this time span, i.e 4 days, 3 hours, 26 minutes and 13.4 seconds. | |
/// </summary> | |
/// <param name="timeSpan"></param> | |
/// <returns></returns> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics.CodeAnalysis; | |
public class SystemTime | |
{ | |
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is OK here.")] | |
public static Func<DateTime> Now = () => DateTime.Now; | |
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is OK here.")] | |
public static Func<DateTime> UtcNow = () => DateTime.UtcNow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Reflection; | |
[Serializable] | |
[DebuggerDisplay("{DisplayName} - {Value}")] | |
public abstract class Enumeration<TEnumeration, TValue> : IComparable<TEnumeration>, IEquatable<TEnumeration> | |
where TEnumeration : Enumeration<TEnumeration, TValue> | |
where TValue : IComparable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Ninject.Modules; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Http; | |
using System.Web.Http.Dependencies; | |
// A small Library to configure Ninject (A Dependency Injection Library) with a WebAPI Application. | |
// To configure, take the following steps. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In Global.asax, in Application_Start make a call to NinjectContainer.Register(...); providing the NinjectModules to configure | |
namespace Test | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using Ninject; | |
using Ninject.Modules; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am spewu on github. | |
* I am spewu (https://keybase.io/spewu) on keybase. | |
* I have a public key ASAeu6D8FdngkLl6N6_Xxv8kAqCaX6oIWFKBD6Ien2_8Ewo | |
To claim this, I am signing this object: |