public void Add(AppointmentAdditionDTO appointmentAddition, int appointmentAdditionId) { AppointmentAddition model = _mapper.Map <AppointmentAddition>(appointmentAddition); model.CreationDate = DateTime.Now; model.CreatedBy = appointmentAdditionId; dbset.Add(model); }
public void Update(AppointmentAdditionDTO appointmentAddition, int appointmentAdditionId) { AppointmentAddition model = _mapper.Map <AppointmentAddition>(appointmentAddition); model.ModifiedDate = DateTime.Now; model.ModifiedBy = appointmentAdditionId; entities.Entry(model).State = EntityState.Modified; entities.Entry(model).Property(m => m.CreatedBy).IsModified = false; entities.Entry(model).Property(m => m.CreationDate).IsModified = false; }