コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: Media.cs プロジェクト: davidwandar/Vodda
        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;
            }
        }
コード例 #3
0
 public override bool Populate(Media media)
 {
     return false;
 }