c# - cannot implicitly convert type 'int?' to system.collection.generic.IEnumerable -
i making small demo in asp.net have created 1 abstract class , implemented in dal, have created poko classes when calling of few properties getting error. here code :
public class personpoko { public int id { get; set; } public string name { get; set; } public int? age { get; set; } public gender gender { get; set; } //assigning gender of type enum public string address { get; set; } public ienumerable<country> countryid { get; set; }//this dropdownlist } public class country //created class fetch dropdownlist records database { public int id { get; set; } public int? countryid { get; set; } public string countryname { get; set; } } public enum gender { m, f }
personabstract.cs
public abstract class personabstract { public abstract ienumerable<personpoko> getallperson(); public abstract bool addperson(personpoko pk); public abstract bool updateperson(personpoko pk, int id); public abstract bool deleteperson(personpoko pk, int id); }
here getting error in dal persondal.cs
public class persondal: personabstract,idisposable { public void dispose() { db = null; db.dispose(); } public ienumerable<personpoko> getallpersons() { return db.procgetallpersons() .asenumerable() .select((letpersonpokoobj)=>new personpoko() { id=letpersonpokoobj.id, name=letpersonpokoobj.name, age=letpersonpokoobj.age, gender=letpersonpokoobj.gender,//here getting error,how call enum. in database have given gender char(1) address=letpersonpokoobj.address, countryid=letpersonpokoobj.countryid//here getting error, cannot implicitly convert type 'int?' system.collection.generic.ienumerable }) } }
can tell me making mistake ? appreciated
Comments
Post a Comment