Created
December 23, 2016 00:36
-
-
Save Vaccano/c8ed812c807b0314c0cd41ac4f78f393 to your computer and use it in GitHub Desktop.
Origin And State Entities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DataAccessLayer | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.Data.Entity.Spatial; | |
[Table("template.Origin")] | |
public partial class Origin | |
{ | |
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] | |
public Origin() | |
{ | |
Shipments = new HashSet<Shipment>(); | |
} | |
public int OriginId { get; set; } | |
[Required] | |
[StringLength(10)] | |
public string Code { get; set; } | |
[Required] | |
[StringLength(100)] | |
public string Name { get; set; } | |
[Required] | |
[StringLength(100)] | |
public string City { get; set; } | |
public int StateId { get; set; } | |
public virtual State State { get; set; } | |
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] | |
public virtual ICollection<Shipment> Shipments { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DataAccessLayer | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.Data.Entity.Spatial; | |
[Table("template.State")] | |
public partial class State | |
{ | |
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] | |
public State() | |
{ | |
// Origins = new HashSet<Origin>(); | |
} | |
[DatabaseGenerated(DatabaseGeneratedOption.None)] | |
public int StateId { get; set; } | |
[Required] | |
[StringLength(2)] | |
public string Abbreviation { get; set; } | |
[Required] | |
[StringLength(50)] | |
public string Name { get; set; } | |
//[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] | |
//public virtual ICollection<Origin> Origins { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment