Exemplo n.º 1
0
        public static string Build(string searchTerm, int?companyId = null, int enforceSearchTermLimit = 0, [System.Runtime.CompilerServices.CallerMemberName] string memberName = "")
        {
            if (!string.IsNullOrEmpty(searchTerm) && searchTerm.Length >= enforceSearchTermLimit)
            {
                searchTerm = FullTextSearchInterceptor.FullTextSearch(searchTerm);
            }

            return(string.IsNullOrEmpty(searchTerm) ? null : searchTerm);
        }
Exemplo n.º 2
0
        private DbCommand GetDbCommand()
        {
            var sqlCommand = new SqlCommand(@"SELECT 
                    [Extent1].[Id] AS [Id], 
                    [Extent1].[FirstName] AS [FirstName], 
                    [Extent1].[SecondName] AS [SecondName]
                    FROM [dbo].[Users] AS [Extent1]
                    WHERE [Extent1].[FirstName] LIKE @p__linq__0 ESCAPE N'~'");

            sqlCommand.Parameters.AddWithValue("p__linq__0", FullTextSearchInterceptor.FullTextSearch("test"));

            return(sqlCommand);
        }