Is it possible to use buillt-in sql functions like user_name() in a LINQ query? If not, can I use something else?
It depends on the provider. For example, in LINQ to Entities against SQL Server you can use SqlFunctions - which has a UserName method which corresponds to USER_NAME() in Transact-SQL. (There are many other methods and properties. For the current user, you can just use the CurrentUser property, for example.)
SqlFunctions
UserName
USER_NAME()
CurrentUser
1.4m articles
1.4m replys
5 comments
57.0k users