Ich habe zwei Tabellen. Die Word
Tabelle enthält eine Liste von Wörtern und die WordForm
Tabelle enthält eine Liste von Wortarten für jedes Wort.Wie bekomme ich eine "flache" Ausgabe von Daten aus einer Eltern/Kind-Tabelle mit LINQ
public class Word
{
public Word()
{
CategoryId = 1;
WordForms = new System.Collections.Generic.List<WordForm>();
}
public string WordId { get; set; } // WordId (Primary key) (length: 20)
public int CategoryId { get; set; } // CategoryId
public virtual System.Collections.Generic.ICollection<WordForm> WordForms { get; set; } // WordForm.FK_WordFormWord
public virtual WordCategory WordCategory { get; set; } // FK_WordWordCategory
}
public class WordForm
{
public string WordFormId { get; set; } // WordFormId (Primary key) (length: 20)
public string WordId { get; set; } // WordId (length: 20)
public int PosId { get; set; } // PosId
public string Definition { get; set; } // Definition
public virtual Pos Pos { get; set; } // FK_WordFormPos
public virtual Word Word { get; set; } // FK_WordFormWord
}
Ich habe versucht, diese beiden Tabellen wie diese Verbindung:
var word = db.Words
.Include(wf => wf.WordForms)
.AsNoTracking()
.FirstOrDefaultAsync();
Das ist mir eine Ausgabe in Objektform gibt.
Wie kann ich zu sehen, was in den Tabellen ist so, dass ich mir Daten wie diese sind zurückgekehrt, wo jede Zeile alle diese Spalten:
WordId CategoryId WordFormId PosId Definition
WordId CategoryId WordFormId PosId Definition
WordId CategoryId WordFormId PosId Definition
WordId CategoryId WordFormId PosId Definition
Wo Sie Ihre Daten tun müssen letztlich platzieren? – Efrain