Example #1
0
 /// <summary>
 /// Creates an album template on the site from a locally created album template
 /// </summary>
 /// <param name="at"></param>
 public async Task<AlbumTemplate> CreateAlbumTemplateAsync(AlbumTemplate at)
 {
     if (at != null)
     {
         // If the album template doesn't exist
         AlbumTemplate myAlbumTemplate = await this.FindAlbumTemplateAsync(at.AlbumTemplateName);
         if (myAlbumTemplate == null)
         {
             // Create it
             at.basic = basic;
             return await at.CreateAsync();
         }
         // Else, return it
         else
             return myAlbumTemplate;
     }
     else
     {
         throw new ArgumentNullException("Album Template parameter is null!");
     }
 }
Example #2
0
 /// <summary>
 /// Creates a new album template with the specified name 
 /// </summary>
 /// <param name="Title"></param>
 /// <returns></returns>
 public async Task<AlbumTemplate> CreateAlbumTemplateAsync(string Name)
 {
     // If the album template doesn't exist
     AlbumTemplate myAlbumTemplate = await this.FindAlbumTemplateAsync(Name);
     if (myAlbumTemplate == null)
     {
         // Create it
         myAlbumTemplate = new AlbumTemplate();
         myAlbumTemplate.AlbumTemplateName = Name;
         myAlbumTemplate.basic = basic;
         return await myAlbumTemplate.CreateAsync();
     }
     // Else, return it
     else
         return myAlbumTemplate;
 }