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
I guess you miss the Edit Function Import dialog, where you can generate Complex Types. try to explore.

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();
....
}