public List <Gender> GetAllGender() { //List <GenderViewModel> gvm = null; //var config = new MapperConfiguration(cfg => //{ // cfg.CreateMap<Gender, GenderViewModel>(); //}); //IMapper mapper = config.CreateMapper(); //gvm = mapper.Map<List<Gender>, List<GenderViewModel>>(g); return(genderrepo.GetGenders()); }
public IActionResult Add() { EmployeeViewModel employeeviewmodel = new EmployeeViewModel(); ViewBag.NationalityId = new SelectList(_nationality.GetNationalities(), "Id", "Name"); ViewBag.GenderId = new SelectList(_gender.GetGenders(), "Id", "Name"); ViewBag.SocialStatusId = new SelectList(_socialstatus.GetSocialStatuss(), "Id", "Name"); ViewBag.ReligionId = new SelectList(_religion.GetReligions(), "Id", "Name"); ViewBag.JobTypeId = new SelectList(_jobtype.GetJobTypes(), "Id", "Name");; //ViewBag.ForeignAgencyId = new SelectList(_foreignagency.GetAgencies(), "Id", "OfficeName"); ; var test = DateTime.UtcNow.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture); return(View(employeeviewmodel)); }
public GenderViewModel GetGenders() { return(new GenderViewModel() { genders = _genderRepository.GetGenders() }); }
public async Task <ActionResult <Gender> > GetListOfGenders() { try { return(Ok(await _repository.GetGenders())); } catch (System.Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "There were error in retrieving the data from the database!")); } }
public async Task <List <Gender> > GetGenders() { try { var items = await _repository.GetGenders(); return(items); } catch (OzoneException ex) { throw new OzoneException(ex.Message, ex.InnerException); } }
public JsonResult GetAll() { var resuList = _genderRepository.GetGenders(); return(Json(resuList, JsonRequestBehavior.AllowGet)); }
public ICollection <GenderModel> GetGenders() { return(_genderRepository.GetGenders()); }
public async Task <IEnumerable <Gender> > GetGenders() { return(await _genderRepository.GetGenders()); }
public List <GenderModel> GetGenders() { return(_genderRepository.GetGenders().Select(x => new GenderModel(x.GenderId, x.Name)).ToList()); }
public async Task OnGet() { Genders = (await _repository.GetGenders()).ToList(); }