Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public InstituicaoMap()
- {
- // Primary Key
- HasKey(t => t.IdInstituicao);
- // Properties
- Property(t => t.Nome)
- .IsRequired()
- .HasMaxLength(255);
- }
- public CampanhaMap()
- {
- // Primary Key
- this.HasKey(t => t.IdCampanha);
- // Properties
- this.Property(t => t.Texto)
- .IsRequired()
- .HasMaxLength(160);
- this.Property(t => t.DataEdicao)
- .IsFixedLength()
- .HasMaxLength(8)
- .IsRowVersion();
- // Relationships
- this.HasRequired(t => t.Instituicao)
- .WithMany(t => t.Campanhas)
- .HasForeignKey(d => d.IdInstituicao);
- }
- return new ContentResult
- {
- Content = JsonConvert.SerializeObject(v),
- ContentType = "application/json"
- };
- [JsonIgnore]
- public virtual Instituicao Instituicao{get;set;}
- public CampanhaMap()
- {
- // Primary Key
- this.HasKey(t => t.IdCampanha);
- // Properties
- this.Property(t => t.Texto)
- .IsRequired()
- .HasMaxLength(160);
- this.Property(t => t.DataEdicao)
- .IsFixedLength()
- .HasMaxLength(8)
- .IsRowVersion();
- // Relationships
- this.HasRequired(t => t.Instituicao)
- .WithMany(t => t.Campanhas)
- .HasForeignKey(d => d.IdInstituicao);
- this.Ignore(t => t.Instituicao);
- }
- public YouContext(): base("name=SchoolDBEntities")
- {
- this.Configuration.LazyLoadingEnabled = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement