//create public QualityMusic Create(QualityMusic qualityMusic) { db.QualityMusics.Add(qualityMusic); if (db.SaveChanges() > 0) { return(qualityMusic); } ; return(null); }
// POST api/<controller> public IHttpActionResult Post(QualityMusicView q) { var item = new QualityMusic { MusicFile = q.MusicFile, MusicID = q.MusicID, NewFile = q.NewFile, QMusicApproved = q.QMusicApproved, QualityID = q.QualityID }; var res = Repositories.CreateQM(item); if (res == true) { return(Ok()); } return(InternalServerError()); }
public static bool CreateQM(QualityMusic qm) { return(MusicBUS.CreateQM(qm)); }
//update public void Update(QualityMusic qualityMusic) { db.Entry(qualityMusic).State = EntityState.Modified; db.SaveChanges(); }
public static bool CreateQM(QualityMusic qm) { var en = new ProjectNCTEntities(); en.QualityMusics.Add(qm); return en.SaveChanges() > 0 ? true : false; }