コード例 #1
0
        public void Add(AppointmentAdditionDTO appointmentAddition, int appointmentAdditionId)
        {
            AppointmentAddition model = _mapper.Map <AppointmentAddition>(appointmentAddition);

            model.CreationDate = DateTime.Now;
            model.CreatedBy    = appointmentAdditionId;
            dbset.Add(model);
        }
コード例 #2
0
        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;
        }