无法先在PostgreSQL代码中使用带有ngsql的Entity Framework 6执行创建存储过程

时间:2018-10-12 07:12:44

标签: asp.net-mvc entity-framework-6 ef-migrations npgsql

我无法使用ASP.NET MVC 5在npgsql中创建存储过程。

我的迁移代码是:

CreateStoredProcedure("dbo.CustomerDetails_Insert",
                p => new
                {
                    p_chrv_ah_name = p.String(maxLength: 150),
                    p_chrv_ah_desig = p.String(maxLength: 50),
                    p_chrv_org_name = p.String(maxLength: 150),
                    p_chrv_org_phone = p.String(maxLength: 50),
                    p_chrv_org_email = p.String(maxLength: 150),
                    p_chrv_org_logo = p.String(maxLength: 150),
                    p_chrv_org_logo_path = p.String(maxLength: 255),
                    p_chrv_pwd = p.String(maxLength: 12),
                    p_tms_agreement_on = p.String(maxLength: 150),
                    p_chrv_agree_scan_copy = p.String(maxLength: 150),
                    p_chrv_agree_scan_copy_path = p.String(maxLength: 150),
                    p_chrv_ip_address = p.String(maxLength: 150)
                },
                body:
                @"  DECLARE id character varying;
                    id= select 'cust' || EXTRACT (month from current_date)|| to_char(current_date,'yy')|| (select LPAD(CAST((select coalesce(max(int_slno),0)+1 from dbo.customer_details) as character varying),2,'0'))
                    INSERT INTO dbo.customer_details(chrv_cust_id,chrv_ah_name,chrv_ah_desig,chrv_org_name,chrv_org_phone,chrv_org_email,chrv_org_logo,chrv_org_logo_path,int_created_by,chrv_ip_address,chrv_pwd,tms_agreement_on,chrv_agree_scan_copy,chrv_agree_scan_copy_path)
                    VALUES(id,p_chrv_ah_name,p_chrv_ah_desig,p_chrv_org_name,p_chrv_org_phone,p_chrv_org_email,p_chrv_org_logo,p_chrv_org_logo_path,0,p_chrv_ip_address,p_chrv_pwd,p_tms_agreement_on,p_chrv_agree_scan_copy,p_chrv_agree_scan_copy_path);
                    "
                );

但我收到此错误

  

NpgsqlMigrationSqlGenerator中未处理的MigrationOperation CreateProcedureOperation

有人对此有解决方案吗?如果是这样,请发布。

预先感谢

0 个答案:

没有答案