Saarth Gandhi

Saarth Gandhi

  • NA
  • 2
  • 473

How to use multiple model with model binder-mvc.net

Jan 9 2018 2:18 AM
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Configuration;
using System.Linq;
using System.Reflection;
using System.Web;
namespace XYZ.DAL
{
public class ApplicationDAL :DbContext {
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<A1>().ToTable("A1");
//modelBuilder.Entity<A2>().ToTable("A2");
// modelBuilder.Entity<A3>().ToTable("A3");
}
public DbSet<A1> A1s { get; set; }
public DbSet<A2> A2s { get; set; }
public DbSet<A3> A3s { get; set; }
}
}

Answers (1)