Some item templates and removal of sqlkata.
This commit is contained in:
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MimeKit;
|
||||
using Serilog;
|
||||
using SqlKata;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Services.Extensions;
|
||||
@@ -29,13 +28,9 @@ public class ContactService : BaseDatabaseService, IContactService
|
||||
if (queryText == null || queryText.Length < 2)
|
||||
return Task.FromResult<List<AccountContact>>(null);
|
||||
|
||||
var query = new Query(nameof(AccountContact));
|
||||
query.WhereContains("Address", queryText);
|
||||
query.OrWhereContains("Name", queryText);
|
||||
|
||||
var rawLikeQuery = query.GetRawQuery();
|
||||
|
||||
return Connection.QueryAsync<AccountContact>(rawLikeQuery);
|
||||
const string query = "SELECT * FROM AccountContact WHERE Address LIKE ? OR Name LIKE ?";
|
||||
var pattern = $"%{queryText}%";
|
||||
return Connection.QueryAsync<AccountContact>(query, pattern, pattern);
|
||||
}
|
||||
|
||||
public Task<AccountContact> GetAddressInformationByAddressAsync(string address)
|
||||
@@ -81,13 +76,9 @@ public class ContactService : BaseDatabaseService, IContactService
|
||||
if (string.IsNullOrWhiteSpace(searchQuery))
|
||||
return GetAllContactsAsync();
|
||||
|
||||
var query = new Query(nameof(AccountContact));
|
||||
query.WhereContains("Address", searchQuery.Trim());
|
||||
query.OrWhereContains("Name", searchQuery.Trim());
|
||||
|
||||
var rawLikeQuery = query.GetRawQuery();
|
||||
|
||||
return Connection.QueryAsync<AccountContact>(rawLikeQuery);
|
||||
const string query = "SELECT * FROM AccountContact WHERE Address LIKE ? OR Name LIKE ?";
|
||||
var pattern = $"%{searchQuery.Trim()}%";
|
||||
return Connection.QueryAsync<AccountContact>(query, pattern, pattern);
|
||||
}
|
||||
|
||||
public async Task<AccountContact> UpdateContactAsync(AccountContact contact)
|
||||
|
||||
Reference in New Issue
Block a user