public JobViewModel ToJobViewModel(Job job) { JobViewModel model = new JobViewModel() { PublisherID = job.PostedByUser.Id, PublisherEmail = job.PostedByUser.Email, PublisherPhoto = job.PostedByUser.ProfilePicUrl, PublisherType = (job.PostedByUser.UserType == 0 ? "Person" : "Company"), PublisherName = (job.PostedByUser.UserType == 0 ? personRepo.GetPerson(job.PostedByUser.Id).FullName : companyRepo.GetCompany(job.PostedByUser.Id).Title), JobID = job.JobID, Title = job.Title, Description = job.Description, Address = job.Address, JobCategory = job.Category.CategoryName, DatePublished = job.DatePublished, Deadline = job.Deadline, Salary = job.Salary }; return(model); }
public IActionResult GetCompany(int id) { return(Ok(compRep.GetCompany(id))); }