Example #1
0
        public async Task SaveAsync(RepositoryItem context)
        {
            var items = await _repository.FindAsync(context.UserId);

            var item = items.SingleOrDefault(x => x.FullName == context.FullName);

            if (item == null)
            {
                item = new RepositoryItem()
                {
                    FullName = context.FullName,
                    Url      = context.Url,
                    UserId   = context.UserId
                };
                await _repository.CreateAsync(item);
            }
            await Task.CompletedTask;
        }