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>();
 }
 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));
 }
        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())
        }
        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; 

        }
 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));
 }