public bool AddFlashCard(FlashCard flashCard) { bool success = false; using (var repo = new FlashCardRepository()) { repo.Add(flashCard); success = true; } return(success); }
public FlashCard GetFlashCard(int id) { var flashCard = new FlashCard(); using (var repo = new FlashCardRepository()) { flashCard = repo.GetOne(id); repo.Context.Entry(flashCard).Collection(x => x.Tags).Load(); repo.Context.Entry(flashCard).Collection(x => x.TextAnserws).Load(); repo.Context.Entry(flashCard).Collection(x => x.FileAnserws).Load(); repo.Context.Entry(flashCard).Reference(x => x.FlashCardData).Load(); } return(flashCard); }