Exemplo n.º 1
0
        public async Task <bool> AddOrUpdate(JsonBase64Item entity)
        {
            try
            {
                JsonBase64Item foundItem = await Select(entity.Id, entity.Position);

                if (foundItem == null)
                {
                    _context.Add(entity);
                }
                else
                {
                    foundItem.Data = entity.Data;
                }

                return(await Task.FromResult(true));
            }
            catch (Exception ex)
            {
                return(await Task.FromResult(false));
            }
        }