public static PartnerType FromModel(this PartnerType viewmodel, PartnerPack model) { viewmodel.ID = model.ID; viewmodel.Name = model.Name; return(viewmodel); }
public static void MigratePartnerPack(DataContext db, MySqlConnection conn, DataSet set, MySqlDataAdapter adapter) { adapter.SelectCommand = new MySqlCommand("Select * from partner_packs", conn); adapter.Fill(set, "partner_packs"); foreach (DataRow row in set.Tables["partner_packs"].Rows) { var pp = new PartnerPack() { Name = Convert.ToString(row["name"]), IsActive = true, }; db.PartnerPack.Add(pp); } db.SaveChanges(); }