Evening, I'm sure this is probably pretty simple ... but Im doing something wrong.
I am trying to create a solution with 3 (now) projects:
- MCV Web Application
- Models
- DAL (Entity Framework)
I want to save the models in another project / assembly from the user interface and the DAL, because the models will be reused between projects, and we may want to change the DAL, etc., without getting confused with the models, etc.
Anyway, the problem.
I created several classes in my model project, for example:
public class Client
{
public int ClientID { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string PhoneNumber { get; set; }
public string Notes { get; set; }
public virtual Contact BillingContact { get; set; }
public virtual ICollection<Contact> Contacts { get; set; }
public virtual ICollection<Invoice> Invoices { get; set; }
}
Then I created the DBC text in DAL
using System.Data.Entity;
using DBDS.Invoice.Models;
namespace DBDS.Invoice.DAL.EF
{
public class InvoiceDataContext : DbContext
{
public DbSet<Client> Clients;
}
}
I turned on migration in the DAL project, added migration and called update-database - the database was created, but with tables NO.
In any case, I'm sure Im going to be tight - any help would be appreciated.
thank