123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DapperORMCore.Dapper
- {
- public class PropertyContainer
- {
- private readonly Dictionary<string, object> _ids;
- private readonly Dictionary<string, object> _values;
- #region Properties
- internal IEnumerable<string> IdNames
- {
- get { return _ids.Keys; }
- }
- internal IEnumerable<string> ValueNames
- {
- get { return _values.Keys; }
- }
- internal IEnumerable<string> AllNames
- {
- get { return _ids.Keys.Union(_values.Keys); }
- }
- internal IDictionary<string, object> IdPairs
- {
- get { return _ids; }
- }
- internal IDictionary<string, object> ValuePairs
- {
- get { return _values; }
- }
- public IEnumerable<KeyValuePair<string, object>> AllPairs
- {
- get { return _ids.Concat(_values); }
- }
- #endregion
- #region Constructor
- internal PropertyContainer()
- {
- _ids = new Dictionary<string, object>();
- _values = new Dictionary<string, object>();
- }
- #endregion
- #region Methods
- internal void AddId(string name, object value)
- {
- _ids.Add(name, value);
- }
- internal void AddValue(string name, object value)
- {
- _values.Add(name, value);
- }
- #endregion
- }
- }
|