NPoco.PocoDataFactory.Guard C# (CSharp) Method

Guard() public static method

public static Guard ( Type type ) : void
type System.Type
return void
        public static void Guard(Type type)
        {
            #if !NET35
            if (type == typeof(System.Dynamic.ExpandoObject) || type == typeof(PocoExpando))
                throw new InvalidOperationException("Can't use dynamic types with this method");
            #endif
        }

Usage Example

Example #1
0
        public TableInfo TableInfoForType(Type type)
        {
            PocoDataFactory.Guard(type);
            var pocoDataBuilder = _pocoDatas.Get(type, () => BaseClassFalbackPocoDataBuilder(type));

            return(pocoDataBuilder.BuildTableInfo());
        }
All Usage Examples Of NPoco.PocoDataFactory::Guard