I have a ASP.net MVC project deployed to Azure.
Website works and links in navigation bar navigate to MVC CRUD views in the url but there is no data.
Microsoft SQL Server Management Studio shows database structure with no data. on Azure. The columns / properties include past versions of properties from all the previous code-based migrations...so the properties / columns, though present on Azure, are not up-to-date.
I think my next step is to use drop create database when model changes or always to get current database properties and data up to Azure. I'm not exactly sure how to write the code for this. below is first unsuccessful attempt in context file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
// end default
// using System.Data.Linq; CreateDatabase
// using System.Data; CreateDatabase
// using System.Data.Object; CreateDatabase
using alpha.Models;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
namespace alpha.Data
{
public class alphaContext : DbContext
{
public alphaContext() : base("alphaContext") // The name of the connection string is passed in to the constructor.
{
// Database.SetInitializer<alphaContext>(new CreateDatabaseAlways<alphaContext>());
}
public DbSet<item> items { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
}
}
My notes including screen captures in a pdf