using System; namespace Pinwheel.Data { public static class LinqAwardRuleExtensions { public static IAwardRule ToIAwardRule(this LinqAwardRule dbRule) { var type = Type.GetType(dbRule.TypeName, true, true); var ruleConstructor = type.GetConstructor(new Type[] { }); return ruleConstructor.Invoke(new object[] { }) as IAwardRule; } } }