public async ValueTask <int> SaveStudyCardAsync(IStudyCard studyCard) { var response = await this.client.SaveStudyCardAsync(new SaveStudyCardRequest() { Card = studyCard.ToGRPCModel() }); return(response.Saved ? 1 : 0); }
// Study Cards public static StudyCard ToGRPCModel(this IStudyCard studyCard) { return(new StudyCard() { Id = studyCard.Id, Question = studyCard.Question, Answer = studyCard.Answer, SubGroupId = studyCard.SubGroupId }); }
private IStudyCard GetStudyCardEntity(IStudyCard studyCard) { if (studyCard is StudyCard) { return(studyCard); } return(new StudyCard() { Id = studyCard.Id, Question = studyCard.Question, Answer = studyCard.Answer, SubGroupId = studyCard.SubGroupId }); }
public ValueTask <int> SaveStudyCardAsync(IStudyCard studyCard) => this.SaveAsync(studyCard);
public ValueTask <int> SaveStudyCardAsync(IStudyCard studyCard) => this.studyCardRepository.SaveStudyCardAsync(studyCard);