Is it possible to use buillt-in sql functions like user_name() in a LINQ query? If not, can I use something else?
See Question&Answers more detail:osIs it possible to use buillt-in sql functions like user_name() in a LINQ query? If not, can I use something else?
See Question&Answers more detail:osIt 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.)