Пример #1
0
        public async Task <IActionResult> Get([FromBody] SearchViewModel model)
        {
            var gender = (int)model.Gender;

            if (gender == -1)
            {
                model.Gender = null;
            }

            float minFees, maxFees = 0;

            float.TryParse(model.MinFees, out minFees);
            float.TryParse(model.MaxFees, out maxFees);

            bool?isOnline = null;

            if (model.Isonline != -1)
            {
                isOnline = model.Isonline == 1;
            }

            var res = lawyerService.GetLawyers(model.ServiceId, model.Name, model.Specialization, model.Gender, model.Rating, minFees, maxFees, model.Prices, isOnline, model.Experiences);

            return(Ok(res));
        }
        public async Task <ActionResult <IEnumerable <Lawyer> > > SearchLawyers(string lawyerName, string lawyerSurname)
        {
            var response = await _myLawyerService.GetLawyers(lawyerName, lawyerSurname);

            return(response.ToList());
        }
Пример #3
0
 public IActionResult GetData()
 {
     return(Ok(lawyerService.GetLawyers()));
 }