public IEnumerable <Labour> GetLabourPayments(int siteId) { var entities = _labourRepo.Find(x => x.SiteId == siteId); var mapper = new LaboursPaymentMapper(); return(mapper.Map(entities.ToList())); }
public void AddLabourPayment(Labour labour) { var mapper = new LaboursPaymentMapper(); var entity = mapper.Map(labour); _labourRepo.Add(entity); _labourRepo.Save(); }
public void DeleteLabour(Labour labour) { var mapper = new LaboursPaymentMapper(); var entity = mapper.Map(labour); var entityToDelete = _labourRepo.Get(entity.LabourId); _labourRepo.Delete(entityToDelete); _labourRepo.Save(); }