コード例 #1
0
        public static List <PLSearchResult> GetParalegalByAOP(PLSearchRequest srcRequest)
        {
            var plEntity = new PLMasterEntities();
            var srcQuery = "";
            var outList  = new List <PLSearchResult>();

            if ((srcQuery = GetSearchText(srcRequest)) == null)
            {
                return(null);
            }

            if (!plEntity.PLByAOPs.Select(area => area.Law_name == srcQuery).Any())
            {
                return(null);
            }

            var searchResults = plEntity.PLByAOPs.Where(area => area.Law_name == srcQuery);

            foreach (var srcresult in searchResults)
            {
                outList.Add(srcresult.toSearchResult());
            }
            return(outList);
            //if(plEntity.Area_of_Law.Join())
        }
コード例 #2
0
        public static List <AreaOfPractise> GetAllAOP()
        {
            var plEntity      = new PLMasterEntities();
            var searchResults = plEntity.Area_of_Law.ToList();

            return(searchResults.ConvertAll <AreaOfPractise>(new Converter <Area_of_Law, AreaOfPractise>(ConvertAOP)));
        }
コード例 #3
0
        public static List <AreaOfPractise> GetTop10AOP()
        {
            var plEntity      = new PLMasterEntities();
            var searchResults = plEntity.Area_of_Law.Take(10).ToList();
            var allaops       = searchResults.ConvertAll <AreaOfPractise>(new Converter <Area_of_Law, AreaOfPractise>(ConvertAOP));

            return(allaops.Take <AreaOfPractise>(10).ToList <AreaOfPractise>());
        }
コード例 #4
0
        public static List <BusinessEntities.Search.Location> GetAllCities()
        {
            var plEntity      = new PLMasterEntities();
            var searchResults = plEntity.Locations.ToList();

            return(searchResults.ConvertAll <BusinessEntities.Search.Location>(
                       new Converter <DAL.Location, BusinessEntities.Search.Location>(ConvertLocation)));
        }
コード例 #5
0
        public static List <PLDetail> GetTop10PLs()
        {
            var plEntity      = new PLMasterEntities();
            var searchResults = plEntity.Para_legal.Take(10).ToList();

            var plDetails = searchResults.ConvertAll <PLDetail>(fn =>
            {
                var plDetail = new PLDetail()
                {
                    ParalegalId = fn.Para_legal_id,
                    Name        = fn.Para_legal_name
                };

                return(plDetail);
            });

            return(plDetails);
        }