Advertisement
Guest User

ArtistModelWebApi

a guest
Sep 20th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. namespace MusicSystem.Services.Models
  2. {
  3. using System;
  4. using System.Linq.Expressions;
  5.  
  6. using MusicSystem.Model;
  7. using System.ComponentModel.DataAnnotations;
  8. using System.Collections.Generic;
  9.  
  10. public class ArtistModel
  11. {
  12. public static Expression<Func<Artist, ArtistModel>> FromArtist
  13. {
  14. get
  15. {
  16. return a => new ArtistModel
  17. {
  18. ArtistId = a.ArtistId,
  19. Name = a.Name,
  20. DateOfBirth = a.DateOfBirth
  21. };
  22. }
  23. }
  24.  
  25. public int ArtistId { get; set; }
  26.  
  27. [Required]
  28. [MinLength(3)]
  29. [MaxLength(10)]
  30. public string Name { get; set; }
  31.  
  32. public DateTime DateOfBirth { get; set; }
  33.  
  34. public ICollection<int> AlbumIds { get; set; }
  35.  
  36. public ICollection<int> SongIds { get; set; }
  37.  
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement