Can not call call Custom Database Functions in linq to entities ASP.net MVC
===

I followed this article [How to: Call Custom Database Functions][1], I have a SQL function that return string , and do not take the argument(the function work fine). 

This is the function in .edmx file :

    <Function Name="GiftCardNo" ReturnType="nvarchar" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="true" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" />

And then I created a class in the same directory, name space with EDMX file :

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Data.Objects.DataClasses;

    namespace POSModel.Store
    {
       public class EdmFunctions
       {
           [EdmFunction("POSModel.Store", "GiftCardNo")]
           public static string GiftCardNo()
           {
              throw new NotSupportedException("This function is only for L2E query.");
           }

       }
    }

And then I called this function in my controller of my ASP.net MVC :

    using (var contexts = new POSEntities())
    {
      _Card.GiftCardNo = POSModel.Store.EdmFunctions.GiftCardNo();
    }

When I run, it error : 

    System.NotSupportedException: This function is only for L2E query.

All the answers are appreciated. Thanks.

  [1]: http://msdn.microsoft.com/en-us/library/dd456847%28VS.100%29.aspx