Calling scalar function from c# using Entity Framework 4.0 / .edmx

前端 未结 5 1374
迷失自我
迷失自我 2020-12-28 15:39

I would like to map my scalar function to my .edmx but it fails. I right click on my entity framework mapping, and choose update model from database. It appears in my stored

5条回答
  •  悲哀的现实
    2020-12-28 16:18

    I guess you miss the Edit Function Import dialog, where you can generate Complex Types. try to explore.

    enter image description here

    If you have successfully created the scalars, you can now navigate like this

    using (var con = new DatabaseEntities())
    {
       long? invoiceNo = con.sp_GetInvoiceMaxNumber(code.Length + 2).First();
       ....
    }
    

提交回复
热议问题