public void Save(NoteDTO entity) { if (!entity.Id.HasValue) { entity.Id = Guid.NewGuid(); } NoteRepository.UpsertEntity(entity); NoteRepository.Commit(); }
public EditNote(Notes manager, NoteDTO entity) { InitializeComponent(); this.Manager = manager; this.Entity = entity; if (!Entity.Id.HasValue) { this.StartPosition = FormStartPosition.CenterScreen; } }
public void Delete(NoteDTO entity) { NoteRepository.DeleteEntity(entity); NoteRepository.Commit(); }