18 lines
539 B
C#
18 lines
539 B
C#
using System.Linq;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using LCU.Library.Internal.DispatcherModels.Models;
|
|
using LCU.Library.Internal.DispatcherModels.Entities;
|
|
namespace LCU.Api.Internal.DispatcherLib.Extensions.Queryables;
|
|
|
|
public static class JobNameQueryable
|
|
{
|
|
public static IQueryable<Job> FilterJobName(this IQueryable<Job> queryable, Filter filter)
|
|
{
|
|
if (filter?.JobName == null)
|
|
{
|
|
return queryable;
|
|
}
|
|
|
|
return queryable.Where(job => job.Name.Contains(filter.JobName));
|
|
}
|
|
} |