Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public class NewGameDefinitionViewModel
  2. {
  3. public string Name { get; set; }
  4. public string Description { get; set; }
  5. public string ReturnUrl { get; set; }
  6. public int BoardGameGeekObjectId { get; set; }
  7. }
  8.  
  9. public class GameDefinition : SecuredEntityWithTechnicalKey<int>
  10. {
  11. public GameDefinition()
  12. {
  13. Active = true;
  14. DateCreated = DateTime.UtcNow;
  15. }
  16.  
  17. public override int Id { get; set; }
  18.  
  19. public override int GamingGroupId { get; set; }
  20.  
  21. public int? BoardGameGeekObjectId { get; set; }
  22.  
  23. [Required]
  24. public string Name { get; set; }
  25. public string Description { get; set; }
  26. public bool Active { get; set; }
  27. public DateTime DateCreated { get; set; }
  28.  
  29. public virtual IList<PlayedGame> PlayedGames { get; set; }
  30. public virtual GamingGroup GamingGroup { get; set; }
  31.  
  32. public int? ChampionId { get; set; }
  33. public int? PreviousChampionId { get; set; }
  34.  
  35. public virtual Champion Champion { get; set; }
  36. public virtual Champion PreviousChampion { get; set; }
  37. }
  38.  
  39. //this throws an AutoMapper.AutoMapperConfigurationException because of unmapped fields. Just want to ignore those
  40. var gameDefinition = Mapper.Map<NewGameDefinitionViewModel, GameDefinition>(newGameDefinitionViewModel);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement