customer = _customerService.GetCustomerBySystemName(SystemCustomerNames.SearchEngine);
Could we somehow cache the searchengine customer object so its really quick when a bot goes to the site?
customer = _customerService.GetCustomerBySystemName(SystemCustomerNames.SearchEngine);
if (customer == null || customer.Deleted || !customer.Active)
{
if (_userAgentHelper.IsSearchEngine())
customer = _customerService.GetCustomerBySystemName(SystemCustomerNames.SearchEngine);
}
exec sp_executesql N'SELECT TOP (1)
[Project1].[Id] AS [Id],
[Project1].[CustomerGuid] AS [CustomerGuid],
[Project1].[Username] AS [Username],
[Project1].[Email] AS [Email],
[Project1].[Password] AS [Password],
[Project1].[PasswordFormatId] AS [PasswordFormatId],
[Project1].[PasswordSalt] AS [PasswordSalt],
[Project1].[AdminComment] AS [AdminComment],
[Project1].[IsTaxExempt] AS [IsTaxExempt],
[Project1].[AffiliateId] AS [AffiliateId],
[Project1].[VendorId] AS [VendorId],
[Project1].[Active] AS [Active],
[Project1].[Deleted] AS [Deleted],
[Project1].[IsSystemAccount] AS [IsSystemAccount],
[Project1].[SystemName] AS [SystemName],
[Project1].[LastIpAddress] AS [LastIpAddress],
[Project1].[CreatedOnUtc] AS [CreatedOnUtc],
[Project1].[LastLoginDateUtc] AS [LastLoginDateUtc],
[Project1].[LastActivityDateUtc] AS [LastActivityDateUtc],
[Project1].[BillingAddress_Id] AS [BillingAddress_Id],
[Project1].[ShippingAddress_Id] AS [ShippingAddress_Id]
FROM ( SELECT
[Extent1].[Id] AS [Id],
[Extent1].[CustomerGuid] AS [CustomerGuid],
[Extent1].[Username] AS [Username],
[Extent1].[Email] AS [Email],
[Extent1].[Password] AS [Password],
[Extent1].[PasswordFormatId] AS [PasswordFormatId],
[Extent1].[PasswordSalt] AS [PasswordSalt],
[Extent1].[AdminComment] AS [AdminComment],
[Extent1].[IsTaxExempt] AS [IsTaxExempt],
[Extent1].[AffiliateId] AS [AffiliateId],
[Extent1].[VendorId] AS [VendorId],
[Extent1].[Active] AS [Active],
[Extent1].[Deleted] AS [Deleted],
[Extent1].[IsSystemAccount] AS [IsSystemAccount],
[Extent1].[SystemName] AS [SystemName],
[Extent1].[LastIpAddress] AS [LastIpAddress],
[Extent1].[CreatedOnUtc] AS [CreatedOnUtc],
[Extent1].[LastLoginDateUtc] AS [LastLoginDateUtc],
[Extent1].[LastActivityDateUtc] AS [LastActivityDateUtc],
[Extent1].[BillingAddress_Id] AS [BillingAddress_Id],
[Extent1].[ShippingAddress_Id] AS [ShippingAddress_Id]
FROM [dbo].[Customer] AS [Extent1]
WHERE ([Extent1].[SystemName] = @p__linq__0) OR (([Extent1].[SystemName] IS NULL) AND (@p__linq__0 IS NULL))
) AS [Project1]
ORDER BY [Project1].[Id] ASC',N'@p__linq__0 nvarchar(4000)',@p__linq__0=N'SearchEngine'