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
2.1m questions
2.1m answers
60 comments
57.0k users