Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

SameModels

a guest Jul 18th, 2018 63 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. namespace SampleMappingAssembly
  2. {
  3.     public  enum AnimalType
  4.     { Dog, Cat, Hamster }
  5.     public class Animal
  6.     {
  7.         Animal() { }
  8.         public int Id { get; set; }
  9.         public Animal(string name, AnimalType animalType)
  10.         {
  11.             Name = name;
  12.             AnimalType = animalType;
  13.         }
  14.         public Animal(string name, AnimalType animalType, Person owner)
  15.             :this(name, animalType)
  16.         {
  17.             Owner = owner;
  18.         }
  19.         public string Name { get; set; }
  20.         public AnimalType AnimalType { get; set; }
  21.         public Person Owner { get; set; }
  22.     }
  23.  
  24.     public class Person
  25.     {
  26.         Person(){}
  27.         public int Id { get; set; }
  28.         public Person(string name)
  29.         {
  30.             Name = name;
  31.             Animals = new List<Animal>();
  32.         }
  33.         public string Name { get; set; }
  34.         public virtual List<Animal> Animals { get; set; }
  35.     }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top