Beispiel #1
0
        public async ValueTask <int> SaveStudyCardAsync(IStudyCard studyCard)
        {
            var response = await this.client.SaveStudyCardAsync(new SaveStudyCardRequest()
            {
                Card = studyCard.ToGRPCModel()
            });

            return(response.Saved ? 1 : 0);
        }
Beispiel #2
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
     });
 }
Beispiel #3
0
        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);
Beispiel #5
0
 public ValueTask <int> SaveStudyCardAsync(IStudyCard studyCard) => this.studyCardRepository.SaveStudyCardAsync(studyCard);