Skip to content

Instantly share code, notes, and snippets.

@mkelley82
Last active October 15, 2015 05:18
Show Gist options
  • Save mkelley82/a5ea03f304b1e4bd56a6 to your computer and use it in GitHub Desktop.
Save mkelley82/a5ea03f304b1e4bd56a6 to your computer and use it in GitHub Desktop.
example of models...
namespace mpk.Models
{
public class District
{
public District()
{
DistrictDistributor = new HashSet<DistrictDistributor>();
DistrictManufacturer = new HashSet<DistrictManufacturer>();
DistrictProduct = new HashSet<DistrictProduct>();
}
public int Id { get; set; }
public int? AddressId { get; set; }
public int? CoopId { get; set; }
public int? CountyId { get; set; }
public string DirectorImgUrl { get; set; }
public string DirectorName { get; set; }
public string Email { get; set; }
public long? EstStudentPop { get; set; }
public DateTime? Modified { get; set; }
public string Name { get; set; }
public string Phone { get; set; }
public short? Ranking { get; set; }
public string RANumber { get; set; }
public long? SchoolCount { get; set; }
public virtual Address Address { get; set; }
public virtual ICollection<DistrictDistributor> DistrictDistributor { get; set; }
public virtual ICollection<DistrictManufacturer> DistrictManufacturer { get; set; }
public virtual ICollection<DistrictProduct> DistrictProduct { get; set; }
public virtual Coop Coop { get; set; }
public virtual County County { get; set; }
}
}
namespace mpk.Models
{
public class DistrictDistributor
{
public int Id { get; set; }
public int DistributorId { get; set; }
public int DistrictId { get; set; }
public virtual Distributor Distributor { get; set; }
[JsonIgnore]
public virtual District District { get; set; }
}
}
namespace mpk.Models
{
public class Coop
{
public Coop()
{
District = new HashSet<District>();
}
public int Id { get; set; }
public DateTime? Modified { get; set; }
public string Name { get; set; }
[JsonIgnore]
public virtual ICollection<District> District { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment