public TargetGroupsModel Populate(TargetGroupsDBModel model)
 {
     this.Id     = model.Id;
     this.Name   = model.Name;
     this.MinAge = model.MinAge;
     this.MaxAge = model.MaxAge;
     return(this);
 }
Example #2
0
        private TargetGroupsDBModel CreateTargetGroupsDBModel(TargetGroupsModel model)
        {
            var dbModel = new TargetGroupsDBModel();

            dbModel.Name   = model.Name;
            dbModel.MaxAge = model.MaxAge;
            dbModel.MinAge = model.MinAge;
            return(dbModel);
        }
Example #3
0
        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);
        }
Example #4
0
        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");
            });
        }