First commit that builds.
This commit is contained in:
22
code/MessengerBroker/Extensions/EntityExtensions.cs
Normal file
22
code/MessengerBroker/Extensions/EntityExtensions.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace MessengerBroker
|
||||
{
|
||||
public static class EntityExtensions
|
||||
{
|
||||
public static IQueryable<Db.Model.User> GetUsers(this IQueryable<Db.Model.User> source, Guid[] guids)
|
||||
{
|
||||
return source.Where(x => guids.Any(g => g == x.Id));
|
||||
}
|
||||
|
||||
public static IQueryable<Db.Model.User> GetUsersExcept(this IQueryable<Db.Model.User> source, IEnumerable<Guid> guids)
|
||||
{
|
||||
return source.Where(x => !guids.Any(g => g == x.Id));
|
||||
}
|
||||
|
||||
public static bool GetUserExists(this IQueryable<Db.Model.User> source, Guid id)
|
||||
{
|
||||
return source.Any(x=> x.Id == id);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user