public static bool IsUserKey(this IUserEntity entity, IKey userKey) => entity.UserId == userKey.AsStringKey().Identifier;
public static T SetUserKey <T>(this T entity, IKey userKey) where T : IUserEntity { entity.UserId = userKey.AsStringKey().Identifier; return(entity); }
public static IQueryable <T> WhereUserKey <T>(this IQueryable <T> query, IKey userKey) where T : IUserEntity => query.Where(e => e.UserId == userKey.AsStringKey().Identifier);