< Summary

Class:Microsoft.Azure.CognitiveServices.Search.EntitySearch.Models.Places
Assembly:Microsoft.Azure.CognitiveServices.Search.BingEntitySearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingEntitySearch\src\Generated\EntitySearch\Models\Places.cs
Covered lines:0
Uncovered lines:14
Coverable lines:14
Total lines:82
Line coverage:0% (0 of 14)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Value()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingEntitySearch\src\Generated\EntitySearch\Models\Places.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.CognitiveServices.Search.EntitySearch.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Collections;
 12    using System.Collections.Generic;
 13    using System.Linq;
 14
 15    /// <summary>
 16    /// Defines a local entity answer.
 17    /// </summary>
 18    public partial class Places : SearchResultsAnswer
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the Places class.
 22        /// </summary>
 023        public Places()
 24        {
 25            CustomInit();
 026        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the Places class.
 30        /// </summary>
 31        /// <param name="value">A list of local entities, such as restaurants
 32        /// or hotels.</param>
 33        /// <param name="id">A String identifier.</param>
 34        /// <param name="contractualRules">A list of rules that you must adhere
 35        /// to if you display the item.</param>
 36        /// <param name="webSearchUrl">The URL To Bing's search result for this
 37        /// item.</param>
 38        public Places(IList<Thing> value, string id = default(string), IList<ContractualRulesContractualRule> contractua
 039            : base(id, contractualRules, webSearchUrl, queryContext)
 40        {
 041            Value = value;
 42            CustomInit();
 043        }
 44
 45        /// <summary>
 46        /// An initialization method that performs custom operations like setting defaults
 47        /// </summary>
 48        partial void CustomInit();
 49
 50        /// <summary>
 51        /// Gets or sets a list of local entities, such as restaurants or
 52        /// hotels.
 53        /// </summary>
 54        [JsonProperty(PropertyName = "value")]
 055        public IList<Thing> Value { get; set; }
 56
 57        /// <summary>
 58        /// Validate the object.
 59        /// </summary>
 60        /// <exception cref="ValidationException">
 61        /// Thrown if validation fails
 62        /// </exception>
 63        public override void Validate()
 64        {
 065            base.Validate();
 066            if (Value == null)
 67            {
 068                throw new ValidationException(ValidationRules.CannotBeNull, "Value");
 69            }
 070            if (Value != null)
 71            {
 072                foreach (var element in Value)
 73                {
 074                    if (element != null)
 75                    {
 076                        element.Validate();
 77                    }
 78                }
 79            }
 080        }
 81    }
 82}