public static IQueryable <AlertEntity> MyActiveAlerts(this Entity e) => As.Expression(() => e.Alerts().Where(a => a.Recipient == UserHolder.Current.ToLite() && a.CurrentState == AlertCurrentState.Alerted));
public static bool IsShared(this ProcessEntity p) => As.Expression(() => !ProcessLogic.JustMyProcesses && p.MachineName == ProcessEntity.None);
public static IQueryable <PredictSimpleResultEntity> SimpleResults(this PredictorEntity e) => As.Expression(() => Database.Query <PredictSimpleResultEntity>().Where(a => a.Predictor.Is(e)));
public string ToStringOriginal() => As.Expression(() => this.CleanName);
public override string ToString() => As.Expression(() => FullClassName);
public static IQueryable <WorkflowConnectionEntity> WorkflowConnections(this WorkflowPoolEntity e) => As.Expression(() => Database.Query <WorkflowConnectionEntity>().Where(a => a.From.Lane.Pool == e && a.To.Lane.Pool == e));
public static IQueryable <PrintLineEntity> Lines(this PrintPackageEntity e) => As.Expression(() => Database.Query <PrintLineEntity>().Where(a => a.Package.Is(e)));
public DateTime Subtract(DateTime date) => As.Expression(() => date.AddYears(-Years).AddMonths(-Months).AddDays(-Days));
public DateTime Add(DateTime date) => As.Expression(() => date.AddDays(Days).AddHours(Hours).AddMinutes(Minutes).AddSeconds(Seconds));
public static IQueryable <WordTemplateEntity> WordTemplates(this WordModelEntity e) => As.Expression(() => Database.Query <WordTemplateEntity>().Where(a => a.Model == e));
public DateTime Add(DateTime date) => As.Expression(() => date.AddYears(Years).AddMonths(Months).AddDays(Days));
public override string ToString() => As.Expression(() => CompanyName);
public static Lite <IsolationEntity>?Isolation(this IEntity entity) => As.Expression(() => ((Entity)entity).Mixin <IsolationMixin>().Isolation);
public static IQueryable <PredictorEpochProgressEntity> EpochProgresses(this PredictorEntity e) => As.Expression(() => Database.Query <PredictorEpochProgressEntity>().Where(a => a.Predictor.Is(e)));
public static IQueryable <WorkflowConnectionEntity> WorkflowMessageConnections(this WorkflowEntity e) => As.Expression(() => e.WorkflowConnections().Where(a => a.From.Lane.Pool != a.To.Lane.Pool));
public DateTime Subtract(DateTime date) => As.Expression(() => date.AddDays(-Days).AddHours(-Hours).AddMinutes(-Minutes).AddMinutes(-Seconds));
public static IQueryable <WorkflowLaneEntity> WorkflowLanes(this WorkflowPoolEntity e) => As.Expression(() => Database.Query <WorkflowLaneEntity>().Where(a => a.Pool == e));
public static IQueryable <TerritoryEntity> Territories(this RegionEntity r) => As.Expression(() => Database.Query <TerritoryEntity>().Where(a => a.Region.Is(r)));
public static IQueryable <WorkflowActivityEntity> WorkflowActivities(this WorkflowLaneEntity e) => As.Expression(() => Database.Query <WorkflowActivityEntity>().Where(a => a.Lane == e));
public static WorkflowEntity Workflow(this CaseActivityEntity ca) => As.Expression(() => ca.Case.Workflow);
public override string ToString() => As.Expression(() => this.CleanName);
public static IQueryable <WorkflowConnectionEntity> PreviousConnections(this IWorkflowNodeEntity e) => As.Expression(() => Database.Query <WorkflowConnectionEntity>().Where(a => a.To == e));
public override string ToString() => As.Expression(() => Name ?? BpmnElementId);
public static bool HasExpired(this WorkflowEntity w) => As.Expression(() => w.ExpirationDate.HasValue && w.ExpirationDate.Value < TimeZoneManager.Now);
public static bool IsMine(this ProcessEntity p) => As.Expression(() => p.MachineName == Environment.MachineName && p.ApplicationName == Schema.Current.ApplicationName);
public static WorkflowEventEntity?WorkflowStartEvent(this WorkflowEntity e) => As.Expression(() => e.WorkflowEvents().Where(we => we.Type == WorkflowEventType.Start).SingleOrDefault());
public override string ToString() => As.Expression(() => UniqueName);
public static IQueryable <WorkflowGatewayEntity> WorkflowGateways(this WorkflowEntity e) => As.Expression(() => Database.Query <WorkflowGatewayEntity>().Where(a => a.Lane.Pool.Workflow == e));
public static IQueryable <PredictorCodificationEntity> Codifications(this PredictorEntity e) => As.Expression(() => Database.Query <PredictorCodificationEntity>().Where(a => a.Predictor.Is(e)));
public static IQueryable <AlertEntity> Alerts(this Entity e) => As.Expression(() => Database.Query <AlertEntity>().Where(a => a.Target.Is(e)));