Exemple #1
0
        private async Task AddTagsToDatabase()
        {
            if (Tags != null)
            {
                foreach (var t in Tags)
                {
                    var existingTag = await _tagDataService.FindTag(t);

                    if (existingTag != null)
                    {
                        t.id_t = existingTag.id_t;
                    }
                    else
                    {
                        await _tagDataService.AddTagAsync(t);

                        var addedTag = await _tagDataService.FindTag(t);

                        if (addedTag != null)
                        {
                            t.id_t = addedTag.id_t;
                        }
                    }
                }
            }
        }