public NoteEx Add(NoteEx item) { try { Note _Note = new Note(); _Note.Note_Name = item.Note_Name; _Note.Note_PageId = item.Note_PageId; _Note.Note_ProductId = item.Note_ProductId; _Note.Note_Content = item.Note_Content; _Note.Note_CreatedDate = DateTime.Now; _Note.Note_ModifiedDate = DateTime.Now; db.Notes.Add(_Note); db.SaveChanges(); return item; } catch(Exception exp) { throw exp; } }
private Note Transform(NoteEx note) { var _note = new Note { Note_Content = note.Note_Content, Note_CreatedDate = note.Note_CreatedDate, Note_Id = note.Note_Id, Note_ModifiedDate = DateTime.Now, Note_Name = note.Note_Name, Note_PageId = note.Note_PageId, Note_ProductId = note.Note_ProductId }; return _note; }