public static Type GetTypeByName(this FeatureContext context, string typeName) { var type = ( from a in AppDomain.CurrentDomain.GetAssemblies() from tnp in context.TypeNamePrefixes() let t = a.GetType(tnp + typeName) where t != null select t ).FirstOrDefault(); if (type == null) { throw new ArgumentException(string.Format("Type \"{0}\" not found", typeName), "typeName"); } return(type); }
public static void AddModelNamespace(this FeatureContext context, string ns) { context.TypeNamePrefixes().Add(ns + "."); }