Ejemplo n.º 1
0
 public PhotoAlbumEntity Add(PhotoAlbumEntity t)
 {
     photoalbum album = new photoalbum();
     Mapper.Map(t, album);
     using (this.mEntities = new photoshareEntities())
     {
         this.mEntities.photoalbums.AddObject(album);
         if (t.Favorite)
         {
             favoritealbum favorite = new favoritealbum();
             Mapper.Map(album, favorite);
             this.mEntities.favoritealbums.AddObject(favorite);
         }
         this.mEntities.SaveChanges();
     }
     return t;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the photoalbums EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTophotoalbums(photoalbum photoalbum)
 {
     base.AddObject("photoalbums", photoalbum);
 }
 /// <summary>
 /// Create a new photoalbum object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="owner">Initial value of the Owner property.</param>
 /// <param name="isSlideshow">Initial value of the IsSlideshow property.</param>
 public static photoalbum Createphotoalbum(global::System.Guid id, global::System.String title, global::System.Guid owner, global::System.Boolean isSlideshow)
 {
     photoalbum photoalbum = new photoalbum();
     photoalbum.Id = id;
     photoalbum.Title = title;
     photoalbum.Owner = owner;
     photoalbum.IsSlideshow = isSlideshow;
     return photoalbum;
 }