Beispiel #1
0
 void IJobAdNotesRepository.CreateNote(JobAdNote note)
 {
     using (var dc = CreateContext())
     {
         dc.JobAdNoteEntities.InsertOnSubmit(note.Map());
         dc.SubmitChanges();
     }
 }
Beispiel #2
0
 void IJobAdNotesRepository.UpdateNote(JobAdNote note)
 {
     using (var dc = CreateContext())
     {
         var entity = GetJobAdNoteEntity(dc, note.Id);
         if (entity != null)
         {
             note.MapTo(entity);
             dc.SubmitChanges();
         }
     }
 }
Beispiel #3
0
        public static JobAdNoteEntity Map(this JobAdNote note)
        {
            var entity = new JobAdNoteEntity
            {
                id          = note.Id,
                createdTime = note.CreatedTime,
                jobAdId     = note.JobAdId,
            };

            note.MapTo(entity);

            return(entity);
        }
Beispiel #4
0
 void IJobAdNotesCommand.UpdateNote(JobAdNote note)
 {
     note.Validate();
     note.UpdatedTime = DateTime.Now;
     _repository.UpdateNote(note);
 }
Beispiel #5
0
 void IJobAdNotesCommand.CreateNote(JobAdNote note)
 {
     note.Prepare();
     note.Validate();
     _repository.CreateNote(note);
 }
Beispiel #6
0
 public static void MapTo(this JobAdNote note, JobAdNoteEntity entity)
 {
     entity.lastUpdatedTime = note.UpdatedTime;
     entity.text            = note.Text;
     entity.ownerId         = note.OwnerId;
 }