vendredi 11 novembre 2016

C# Asp.net database. I got this error codes

I make a simple database for my project using asp.net When trying to build solution i got this error..

Severity Code Description Project File Line Suppression State Error CS1061 'Product' does not contain a definition for 'Inventories' and no extension method 'Inventories' accepting a first argument of type 'Product' could be found (are you missing a using directive or an assembly reference?) ShopDairy D:\Visual Studio\ShopDairy\ShopDairy\Controllers\ProductsController.cs 20 Active

Severity Code Description Project File Line Suppression State Error CS1061 'Product' does not contain a definition for 'Categories' and no extension method 'Categories' accepting a first argument of type 'Product' could be found (are you missing a using directive or an assembly reference?) ShopDairy D:\Visual Studio\ShopDairy\ShopDairy\Controllers\ProductsController.cs 20 Active

and here's the codes...

public class Product:FullAuditedEntity
{

    [MaxLength(250)]
    public string Name { get; set; }

    public Guid InventoryId { get; set; }
    public Inventory Inventory { get; set; }
    public Guid CategoryId { get; set; }
    public Category Category { get; set; }
    public ICollection<Wishlist> Wishlists { get; set; }
}

and other...

  public class Inventory:FullAuditedEntity
{
    public int Quantity { get; set; }
    public DateTime ExpirationDate { get; set; }

    public decimal Price { get; set; }

    public Guid StorageId { get; set; }
    public Storage Storage { get; set; }
    public ICollection<Product> Products { get; set; }

}

I rename the every ICollection<> and this error apearing.. Before i rename it, all of this worked.

Am i missing something? Please help, thanks before.




Aucun commentaire:

Enregistrer un commentaire