how to declare a list of object nullable asp .net

asp.net asp.net-mvc c# entity-framework-6 visual-studio

Accepted Answer

My best guess, based on your illustration, is that you intended that your Employer object may contain 0 or more BonDeCommande objects. as a resultList<BonDeCommande> is what you want. (which might instead include an empty list, or null)

public class Employer {
    public string code {get; set;}
    public string mdp {get; set;}
    ...
    public List<BonDeCommande> bonDeCommandes {get; set;}
}
2
7/19/2017 12:12:05 PM

Popular Answer

List<int?> aList = new List<int?>();

The asterisk indicates that the value might be null.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow