If the Model class which you have shown above is the Entity Model class which is mapped to your database, which is quite clear from your code, you would need to create a ViewModel class and use that in your view, so create a ViewModel first:
public class ArticleViewModel
{
public int ART_Id { get; set; }
[Display(Name = "Sous Categorie")]
public string SCAT_Libelle { get; set; }
[Display(Name = "Libelle")]
public string ART_Libelle { get; set; }
[Display(Name = "Description")]
public string ART_Description { get; set; }
[Display(Name="Prix")]
public decimal ART_Prix { get; set; }
[Display(Name = "Stock")]
public int ART_Stock { get; set; }
}
and then in your controller action change your query to have a join between both table on the
ART_SCAT_Id and project the result in List of type your new create ViewModel, in your case you need to update the definition of method:
public static List<ArticleViewModel> SelectAllArticle()
{
var articles = new List<ArticleViewModel>();
using (var context = new WebShopEntities())
{
var result = from article in context.Article
join subCategory in context.subCategory
on article.ART_SCAT_Id equals subCategory.SCAT_CAT_Id
foreach (var item in result)
{
rtn.Add(new ArticleViewModel
{
ART_Id = article.ART_Id,
SCAT_Libelle = subCategory.SCAT_Libelle,
ART_Libelle = article.ART_Libelle,
ART_Description = article.ART_Description,
ART_Prix = article.ART_Prix,
ART_Stock = article.ART_Stock
});
}
}
return articles;
}
Hope it helps.