コード例 #1
0
 public GuidPropertyMapping(GuidColumn column, IMemberAccessor member, int fileIndex, int workIndex)
 {
     this.column    = column;
     this.member    = member;
     this.FileIndex = fileIndex;
     this.WorkIndex = workIndex;
 }
コード例 #2
0
        public void TestGuidColumn()
        {
            var g = Guid.NewGuid();
            var o = new GuidColumn {
                TheGuid = g
            };

            o.Save();

            var o1 = GuidColumn.FindById(o.Id);

            Assert.IsNotNull(o1);
            Assert.AreEqual(g, o1.TheGuid);

            var g1 = Guid.NewGuid();

            o1.TheGuid = g1;
            o1.Save();

            Assert.IsFalse(g == g1);

            var o2 = GuidColumn.FindById(o.Id);

            Assert.IsTrue(g1 == o2.TheGuid);
        }
コード例 #3
0
 public GuidPropertyMapping(GuidColumn column, IMemberAccessor member, int physicalIndex, int logicalIndex)
 {
     this.column   = column;
     Member        = member;
     PhysicalIndex = physicalIndex;
     LogicalIndex  = logicalIndex;
 }
コード例 #4
0
        /// <summary>
        /// Returns dictionary. Throws an exception if the key column does not contains unique values.
        ///
        /// </summary>
        /// <param name="pResult"/><param name="pKeyColumn"/><param name="valueColumn"/>
        /// <returns/>
        public static IDictionary <Guid, string> ToDictionary(IResult pResult, GuidColumn pKeyColumn, StringColumn valueColumn)
        {
            Dictionary <Guid, string> dictionary = new Dictionary <Guid, string>();
            int pIndex = 0;

            while (pIndex < pResult.Count)
            {
                Guid   key = (Guid)pResult.GetRow(pKeyColumn.Table, pIndex).GetValue(pKeyColumn);
                string str = (string)pResult.GetRow(valueColumn.Table, pIndex).GetValue(valueColumn);
                dictionary.Add(key, str);
                checked { ++pIndex; }
            }
            return((IDictionary <Guid, string>)dictionary);
        }
コード例 #5
0
        /// <summary>
        /// Returns list of distinct Guids
        ///
        /// </summary>
        /// <param name="pResult"/><param name="column"/>
        /// <returns/>
        public static IList <Guid> ToList(IResult pResult, GuidColumn column)
        {
            List <Guid> list   = new List <Guid>();
            int         pIndex = 0;

            while (pIndex < pResult.Count)
            {
                Guid guid = (Guid)pResult.GetRow(column.Table, pIndex).GetValue(column);
                if (!list.Contains(guid))
                {
                    list.Add(guid);
                }
                checked { ++pIndex; }
            }
            return((IList <Guid>)list);
        }
コード例 #6
0
 public GuidPropertyMapping(GuidColumn column, PropertyInfo property)
 {
     this.column   = column;
     this.property = property;
 }
コード例 #7
0
 public IUpdateSet Set(GuidColumn column, Guid value)
 {
     this.mSetValueList.Add(new SetValue(column, value));
     return(this);
 }
コード例 #8
0
 public static FMSScheduleDetailIdAsString CreateFrom(GuidColumn t)
 {
     return(GuidColumnAsString.CreateFrom <FMSScheduleDetailIdAsString>(t));
 }
コード例 #9
0
 public GuidPropertyMapping(GuidColumn column, PropertyInfo property)
 {
     this.column = column;
     this.property = property;
 }