Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public static void AddModelNamespace(this FeatureContext context, string ns)
 {
     context.TypeNamePrefixes().Add(ns + ".");
 }