<connectionStrings> <add name="DatabaseContext" connectionString="Data Source= ACER-PC; Integrated Security=true;Initial Catalog=Practise; uid=sa; Password=srujana; " providerName="System.Data.SqlClient" /> </connectionStrings>
public class DatabaseContext:DbContext { public DbSet<Product> Products { get; set; } public DbSet<ProductGroup> ProductGroups { get; set; } } model classes: public class ProductGroup { [Key] public int ProductGroupID { get; set; } [Required] public int ProductGroupName { get; set; } [Required] public string Country { get; set; } [StringLength(255)] public string CreatedBy { get; set; } [ScriptIgnore] public virtual ICollection<Product> Products { get; set; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)