public List <DissertationCouncil> GetAll(DissertationCouncilFilter filter)
        {
            IEnumerable <DissertationCouncil> result = base.GetAll();

            if (filter != null)
            {
                if (!string.IsNullOrWhiteSpace(filter.ScientificSpecialityCode))
                {
                    result = result.Where(s => s.ScientificSpecialities.Any(ss => ss.Code.ToUpperInvariant().Contains(filter.ScientificSpecialityCode.ToUpperInvariant())));
                }
                if (!string.IsNullOrWhiteSpace(filter.ScientificSpecialityName))
                {
                    result = result.Where(s => s.ScientificSpecialities.Any(ss => ss.Name.ToUpperInvariant().Contains(filter.ScientificSpecialityName.ToUpperInvariant())));
                }
            }
            return(result.OrderBy(s => s.Code).ToList());
        }
Пример #2
0
 public IHttpActionResult Get([FromUri] DissertationCouncilFilter filter)
 {
     try
     {
         List <DissertationCouncilModel> list = _repository.GetAll(filter).Select(MapEntityToModel).ToList();
         var content = new EntitiesListResult <DissertationCouncilModel>
         {
             Data     = list,
             Page     = -1,
             PageSize = -1
         };
         ;
         content.Total = list.Count;
         return(Ok(content));
     }
     catch (Exception e)
     {
         return(HandleException(e));
     }
 }