Tigran hace 4 años
padre
commit
f24f2925b5

+ 4 - 4
CardCollector/DataBase/Entity/UserEntity.cs

@@ -1,19 +1,18 @@
+using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.ComponentModel.DataAnnotations.Schema;
 using System.Linq;
 using System.Threading.Tasks;
-using CardCollector.Controllers;
 using CardCollector.DataBase.EntityDao;
 using CardCollector.Others;
 using CardCollector.Resources;
-using Telegram.Bot.Types.InlineQueryResults;
 
 namespace CardCollector.DataBase.Entity
 {
     /* Этот класс представляет собой строку таблицы users и описывает объект пользователя */
     [Table("users")]
-    public partial class UserEntity
+    public class UserEntity
     {
         /* Id пользователя */
         [Key]
@@ -52,7 +51,8 @@ namespace CardCollector.DataBase.Entity
             if (Constants.UNLIMITED_ALL_STICKERS) return await StickerDao.GetAll(filter);
             return Stickers.Values
                 .Where(relation => relation.Count > 0)
-                .Select(rel => StickerDao.GetStickerByHash(rel.ShortHash).Result);
+                .Select(rel => StickerDao.GetStickerByHash(rel.ShortHash).Result)
+                .Where(sticker => sticker.Title.Contains(filter, StringComparison.CurrentCultureIgnoreCase));
         }
 
         public UserEntity()

+ 1 - 1
CardCollector/DataBase/EntityDao/StickerDao.cs

@@ -57,7 +57,7 @@ namespace CardCollector.DataBase.EntityDao
         {
             var list = await Table.ToListAsync();
             return filter == "" ? list : list.Where
-                (item => item.Title.Contains(filter, StringComparison.OrdinalIgnoreCase)).ToList();
+                (item => item.Title.Contains(filter, StringComparison.CurrentCultureIgnoreCase)).ToList();
         }
 
         public static async Task AddNew(StickerEntity sticker)

+ 1 - 1
CardCollector/Extensions.cs

@@ -51,7 +51,7 @@ namespace CardCollector
             foreach (var relation in dict.Values.Where(i => i.Count > 0))
             {
                 var sticker = await StickerDao.GetStickerByHash(relation.StickerId);
-                if (sticker.Title.Contains(filter, StringComparison.OrdinalIgnoreCase)) result.Add(sticker);
+                if (sticker.Title.Contains(filter, StringComparison.CurrentCultureIgnoreCase)) result.Add(sticker);
             }
             return result;
         }