Exemplo n.º 1
0
        public override int CalculateSearchHashCode()
        {
            var hashCode = base.CalculateSearchHashCode();

            hashCode += UniqueResult.GetHashCode();

            if (Type != null)
            {
                hashCode += Type.GetHashCode();
            }

            if (OutputColumns != null)
            {
                OutputColumns.ForEach(x => hashCode += x.CalculateSearchHint());
            }

            if (SortColumns != null)
            {
                SortColumns.ForEach(x => hashCode += x.CalculateSearchHint());
            }

            if (Criteria != null)
            {
                Criteria.ForEach(x => hashCode += x.CalculateSearchHashCode());
            }

            return(hashCode);
        }
Exemplo n.º 2
0
        private async Task UpdateData(string uri, string text)
        {
            if (await _repository.AnyUri(uri))
            {
                var data = await _repository.GetByUri(uri);

                data.Result = text;
                await _repository.Update(data);
            }
            else
            {
                var data = new UniqueResult {
                    Result = text, Uri = uri, Id = Guid.NewGuid().ToString()
                };
                await _repository.Add(data);
            }
        }