Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. CRUD Views For Many-Many Relationship, Checkboxes
  2. public class Project
  3. {
  4.     public int ProjectId { get; set; }
  5.     public string Title { get; set; }
  6.     public string Description { get; set; }
  7.     public string Testimonial { get; set; }
  8.  
  9.     public virtual ICollection<Image> Images { get; set; }
  10.     public virtual ICollection<Category> Categories { get; set; }
  11.  
  12.     public Project()
  13.     {
  14.         Categories = new HashSet<Category>();
  15.     }
  16. }
  17.  
  18. public class Category
  19. {
  20.     public int CategoryId { get; set; }
  21.     public string Name { get; set; }
  22.  
  23.     public ICollection<Project> Projects { get; set; }
  24.  
  25.     public Category()
  26.     {
  27.         Projects = new HashSet<Project>();
  28.     }
  29. }