public RatingResponse(Rating rating) { Id = rating.Id; Star = rating.Star; Comment = rating.Comment; Freelancer = new ResponseIdName(rating.Freelancer); Renter = new ResponseIdName(rating.Renter); Job = new ResponseIdName(rating.Job); }
public JobResponseModel(Job job) { Id = job.Id; Name = job.Name; Deadline = job.Deadline; Specialty = new ResponseIdName(job.S.Specialty); Service = new ResponseIdName(job.S.Service); Renter = new ResponseIdName(job.RenterId, job.Renter.Name); Freelancer = job.Freelancer != null? new ResponseIdName(job.Freelancer.Id, job.Freelancer.Name):null; Cellingprice = job.Cellingprice; Details = job.Details; Floorprice = job.Floorprice; Payform = new ResponseIdName(job.Payform); FormOfWork = new ResponseIdName(job.Form); TypeOfWork = new ResponseIdName(job.Type); CreateAt = job.CreateAt; Province = job.Province != null? new ProvinceResponse(job.Province):null; Status = job.Status; Skills = job.JobSkills .Select(p => new ResponseIdName(p.Skill)).ToList(); }