public TargetGroupsModel Populate(TargetGroupsDBModel model) { this.Id = model.Id; this.Name = model.Name; this.MinAge = model.MinAge; this.MaxAge = model.MaxAge; return(this); }
private TargetGroupsDBModel CreateTargetGroupsDBModel(TargetGroupsModel model) { var dbModel = new TargetGroupsDBModel(); dbModel.Name = model.Name; dbModel.MaxAge = model.MaxAge; dbModel.MinAge = model.MinAge; return(dbModel); }
private TargetGroupsModel CreateTargetGroupsModel(TargetGroupsDBModel model) { var viewModel = new TargetGroupsModel(); viewModel.Id = model.Id; viewModel.Name = model.Name; viewModel.MaxAge = model.MaxAge; viewModel.MinAge = model.MinAge; return(viewModel); }
protected override void OnModelCreating(DbModelBuilder modelBuilder) { CategoryDBModel.OnModelCreating(modelBuilder); TargetGroupsDBModel.OnModelCreating(modelBuilder); modelBuilder.Entity <CategoryDBModel>() .HasMany(s => s.TargetGroups) .WithMany(c => c.CategoryDBModels) .Map(cs => { cs.MapLeftKey("CategoryDBModelId"); cs.MapRightKey("TargetGroupsDBModelId"); cs.ToTable("CategoryTargetGroups"); }); }