namespace Connected.Extensions { public static class ObjectExtensions { public static T As(this object self) { if (self == null || !(self is T)) return default(T); return (T)self; } } }