mvc: mentions

This commit is contained in:
metoou
2021-05-13 11:19:38 +03:00
parent a9a48d5816
commit b6b980de92
3 changed files with 45 additions and 0 deletions

View File

@ -17,6 +17,7 @@
*/
using System.Collections.Generic;
using System.Linq;
namespace OnlineEditorsExampleMVC.Helpers
{
@ -42,6 +43,24 @@ namespace OnlineEditorsExampleMVC.Helpers
{
return users;
}
public static List<Dictionary<string, object>> getUsersForMentions(string id)
{
List<Dictionary<string, object>> usersData = new List<Dictionary<string, object>>();
foreach (User user in users)
{
if (!user.id.Equals(id) && user.name != null && user.email != null)
{
usersData.Add(new Dictionary<string, object>()
{
{"name", user.name },
{"email", user.email },
});
}
}
return usersData;
}
}
public class User