<commit_before>﻿using System;
using System.Runtime.Serialization;
using Merchello.Core.Models.EntityBase;

namespace Merchello.Core.Models
{
    /// <summary>
    /// Defines a product attribute
    /// </summary>
    [Serializable]
    [DataContract(IsReference = true)]
    internal sealed class ProductAttribute : Entity, IProductAttribute
    {
        private string _name;
        private string _sku;
     

        public ProductAttribute(string name, string sku)
        {
            Mandate.ParameterNotNullOrEmpty(name, "name");
            Mandate.ParameterNotNullOrEmpty(sku, "sku");
            
            Key = Guid.NewGuid();
            HasIdentity = false;

            _name = name;
            _sku = sku;
        }

        /// <summary>
        /// The id of the option which defines the attribute group this attribute belongs to
        /// </summary>
        [DataMember]
        public Guid OptionKey { get; set; }


        /// <summary>
        /// The name of the attribute
        /// </summary><commit_msg>Added comment to ProductAttribute<commit_after>﻿using System;
using System.Runtime.Serialization;
using Merchello.Core.Models.EntityBase;

namespace Merchello.Core.Models
{
    /// <summary>
    /// Defines a product attribute
    /// </summary>
    [Serializable]
    [DataContract(IsReference = true)]
    internal sealed class ProductAttribute : Entity, IProductAttribute
    {
        private string _name;
        private string _sku;
     

        public ProductAttribute(string name, string sku)
        {
            Mandate.ParameterNotNullOrEmpty(name, "name");
            Mandate.ParameterNotNullOrEmpty(sku, "sku");
            
            // This is required so that we can create attributes from the WebApi without a lot of 
            // round trip traffic to the db to generate the Key(s).  Key is virtual so also forces
            // this class to be sealed
            Key = Guid.NewGuid();
            HasIdentity = false;

            _name = name;
            _sku = sku;
        }

        /// <summary>
        /// The id of the option which defines the attribute group this attribute belongs to
        /// </summary>
        [DataMember]
        public Guid OptionKey { get; set; }


        /// <summary>
        /// The name of the attribute
        /// </summary>
{'fraction_non_alphanumeric': 0.09379014989293362, 'fraction_numerical': 0.0, 'mean_word_length': 1.8592411260709913, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2226481', 'n_tokens_mistral': 604, 'n_tokens_neox': 594, 'n_words': 189}