public int Create(Note note) { note.CreatedOn = DateTime.Now; this.dbContext.Notes.Add(note); this.dbContext.SaveChanges(); return note.Id; }
public bool Delete(Note note) { if (note != null) { this.dbContext.Notes.Remove(note); this.dbContext.SaveChanges(); return true; } return false; }
public int Note(int projectId, int userId,string message) { Note note = new Note() { ProjectId = projectId, Message = message, CreatedById = userId }; int createdId = this.repo.Create(note); return createdId; }
private bool SaveChanges(Note note) { return this.repo.SaveChanges(note); }
public bool SaveChanges(Note note) { this.dbContext.Entry(note).State = System.Data.Entity.EntityState.Modified; int result = this.dbContext.SaveChanges(); return result > 0; }