I'm new to the ASP.Net/MVC/WebApi. And I am developing a test project (Inventory Control) to learn about Web Api.
And this is my class structure. (ProductType, ProductCategory, Product. And; )
ProductType
public class ProductType
{
public ProductType()
{
Products = new List<Product>();
ProductCategories = new List<ProductCategory>();
}
[ScaffoldColumn(false)]
public int Id { get; set; }
[Required]
public string Name { get; set; }
public virtual ICollection<ProductCategory> ProductCategories { get; set; }
public virtual ICollection<Product> Products { get; set; }
}
ProductCategory
public class ProductCategory
{
public ProductCategory()
{
Products = new List<Product>();
}
[ScaffoldColumn(false)]
public int Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public ProductType ProductType { get; set; }
public virtual ICollection<Product> Products { get; set; }
}
Product
public class Product
{
[ScaffoldColumn(false)]
public int Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public ProductType ProductType { get; set; }
[Required]
public ProductCategory ProductCategory { get; set; }
}
And as a sample; I need the Product Category WPF form as follows,
And I want to use MSSQL Server 2012 Express as my database engine. Also need to host in a local IIS server.
I have tried this work for some levels with a LocalDb. But when I changed a class database not updating and I couldn't do any further update on it, always getting me to errors. Also tried to publish to my local IIS. But no any good result.
Please help me from class declaration to publish the service in a local IIS server with a database in a SQL Server Express.
I tried this for months; But still in errors. Please give me some introductory A to Z sample.
Seevali
0 Points
11 Posts
Getting started with Web API for a inventory control system.
Dec 30, 2012 11:43 AM|LINK
I'm new to the ASP.Net/MVC/WebApi. And I am developing a test project (Inventory Control) to learn about Web Api.
And this is my class structure. (ProductType, ProductCategory, Product. And; )
public class ProductType { public ProductType() { Products = new List<Product>(); ProductCategories = new List<ProductCategory>(); } [ScaffoldColumn(false)] public int Id { get; set; } [Required] public string Name { get; set; } public virtual ICollection<ProductCategory> ProductCategories { get; set; } public virtual ICollection<Product> Products { get; set; } }public class ProductCategory { public ProductCategory() { Products = new List<Product>(); } [ScaffoldColumn(false)] public int Id { get; set; } [Required] public string Name { get; set; } [Required] public ProductType ProductType { get; set; } public virtual ICollection<Product> Products { get; set; } }public class Product { [ScaffoldColumn(false)] public int Id { get; set; } [Required] public string Name { get; set; } [Required] public ProductType ProductType { get; set; } [Required] public ProductCategory ProductCategory { get; set; } }And as a sample; I need the Product Category WPF form as follows,
And I want to use MSSQL Server 2012 Express as my database engine. Also need to host in a local IIS server.
I have tried this work for some levels with a LocalDb. But when I changed a class database not updating and I couldn't do any further update on it, always getting me to errors. Also tried to publish to my local IIS. But no any good result.
Please help me from class declaration to publish the service in a local IIS server with a database in a SQL Server Express.
I tried this for months; But still in errors. Please give me some introductory A to Z sample.
Thank You.
Seevali.
urenjoy
Star
11997 Points
1797 Posts
Re: Getting started with Web API for a inventory control system.
Dec 30, 2012 12:18 PM|LINK
Have a look at following:
http://msdn.microsoft.com/en-us/data/jj554735.aspx
http://msdn.microsoft.com/en-us/data/jj193542.aspx
http://stackoverflow.com/questions/4485742/ef-code-first-recreate-database-if-model-changes