I have added my table “tblFile” to my .dbml , but it’s type is “EntitySet tblFiles
But for another table with the same Association, its type is “tblDocTranstoCon”
So I have problem in the below linq query “w” is not IEnumerable but “z” is “IEnumerable”
z = document.tblTransmittalls.Select(dp => dp.tblDocTranstoCons),
w = document.tblTransmittalls.Select(dx => dx.tblFiles)
How I can solve this problem for producing IEnumerable.
[Association(Name="tblTransmittall_tblFile", Storage="_tblFiles", ThisKey="DocID,TransId", OtherKey="DocId,TransId")]
public EntitySet<tblFile> tblFiles
{
get
{
return this._tblFiles;
}
set
{
this._tblFiles.Assign(value);
}
}
[Association(Name="tblTransmittall_tblDocTranstoCon", Storage="_tblDocTranstoCons", ThisKey="DocID,TransId", OtherKey="Docid,Transid", IsUnique=true, IsForeignKey=false)]
public tblDocTranstoCon tblDocTranstoCons
{
get
{
return this._tblDocTranstoCons.Entity;
}
You should try this
because
tblFileshas return typeEntitySet<tblFile>(which is a Collection) whereastblDocTranstoConshas return typetblDocTranstoConor you should change its association in dbml designer.