public override bool Populate(Media media) { /* Is media already registred at this supplier * + has interval passed * + search by supplieridentifier * + update properties (price etc) * - search by title * + update * - delete * - return * - search by title * + insert * * * */ return true; }
public Media GetMedia() { using (MediaContext db = new MediaContext()) { Media media = db.Medias.FirstOrDefault(s => s.Name == this.Name); if (media == null) { //No such supplier, add new Media m = new Media(); m.Name = this.Name; m.CoverUrl = this.CoverUrl; m.Created = DateTime.Now; db.Medias.Add(m); db.SaveChanges(); return m; } return media; } }
public override bool Populate(Media media) { return false; }