Beispiel #1
0
        public List <OPDHistoryModel> GetByStatus(params string[] status)
        {
            try
            {
                Expression <Func <OPDHistory, bool> > predicate = null;

                foreach (var item in status)
                {
                    if (predicate != null)
                    {
                        Expression <Func <OPDHistory, bool> > predicateFilter = t => t.Status.Name == item;
                        predicate = PredicateBuilder.OrElse <OPDHistory>(predicate, predicateFilter);
                    }
                    else
                    {
                        predicate = t => t.Status.Name == item;
                    }
                }


                OPDHistory entity = new OPDHistory();
                return(entity.GetByStatus(predicate));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }