private static Type CreateEntityType( EntityInfo entity, ModuleBuilder entityModule) { string cliTypeName = TypeHelper.NormalizeForCliTypeName(entity.TableName); TypeBuilder entityTypeBuilder = entityModule.DefineType(cliTypeName, TypeAttributes.Public); foreach (EntityPropertyInfo property in entity.Properties) { EmitHelper.AddProperty(entityTypeBuilder, property.Name, property.ClrType); } return(entityTypeBuilder.CreateType()); }