using MAX.Core.Commons;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Store.Product.Models.Product
{
///
/// 商品属性
///
public partial class ProductPropertys : List
{
///
/// 是否存在Key
///
///
///
public bool ContainsKey(string key)
{
return Exists(a => a.Key == key);
}
///
/// 添加数据
///
///
///
public void Add(string Key, string Value)
{
if (!ContainsKey(Key))
{
Add(new CommonKeyValue() { Key = Key, Value = Value });
}
}
///
/// 获取值
///
///
///
public string GetValue(string key)
{
if (ContainsKey(key))
{
CommonKeyValue p = this.FirstOrDefault(a => a.Key == key);
return p.Value;
}
return "";
}
}
}