예제 #1
0
        public void UpdateHourRate(CreateHourRateDto hourRate)
        {
            var existingRate = _context.HourRate
                               .Where(hr => hr.FromDate == hourRate.FromDate && hr.TaskId == hourRate.TaskId)
                               .FirstOrDefault();

            existingRate.Rate = hourRate.Rate;
            _context.SaveChanges();
        }
예제 #2
0
        public void CreateHourRate(CreateHourRateDto hourRate)
        {
            var newRate = new HourRate
            {
                FromDate = hourRate.FromDate,
                Rate     = hourRate.Rate,
                TaskId   = hourRate.TaskId
            };

            _context.HourRate.Add(newRate);
            _context.SaveChanges();
        }