linq到实体orderby

Nao*_*aor 4 .net c# linq-to-entities entity-framework

如何将此查询转换为linq到具有实体框架的实体:

SELECT  customer_id,
    customer_name,
    customer_code
FROM dbo.V_STF_CUSTOMER
WHERE   company_id=@company_id AND
ORDER BY    CASE
            WHEN ISNUMERIC(customer_name)=1 THEN 1
            ELSE 0
        END,
        customer_name
Run Code Online (Sandbox Code Playgroud)

我有这个:

return CUstomers.GetQuery().
            Where(x => x.CompanyId == companyId).
        OrderBy(??This is my problem??);
Run Code Online (Sandbox Code Playgroud)

我不知道如何翻译orderby.任何的想法?

Osk*_*lin 8

return Customers.GetQuery().
            Where(x => x.CompanyId == companyId).
        OrderBy(x=> SqlFunctions.IsNumeric(x.customer_name)).
        ThenBy(x=> x.customer_name);
Run Code Online (Sandbox Code Playgroud)