コード例 #1
0
        public void Empty()
        {
            IKeyedEnumerable <int> empty = KeyedEnumerable <int> .Empty();

            Assert.AreEqual(Guid.Empty, empty.Key);
            CollectionAssert.IsEmpty(empty.Items);
        }
コード例 #2
0
        public AttributedMetaType(Type type)
            : base(type)
        {
            _table = type.Name;

            TableAttribute[] attrs = (TableAttribute[])type
                                     .GetCustomAttributes(typeof(TableAttribute), true);

            if (attrs != null && attrs.Length > 0)
            {
                TableAttribute attr = attrs[0];

                _schema         = attr.Schema;
                _table          = attr.Name;
                _projection     = attr.Projection;
                _serializerType = attr.Serializer;
            }
            _members = GetMembers(type);
            _keys    = _members.Where(a => a.IsKey).AsReadOnly();
        }
コード例 #3
0
		public AttributedMetaType (Type type)
			: base(type)
		{
			_table = type.Name;
			
			TableAttribute[] attrs = (TableAttribute[])type
				.GetCustomAttributes(typeof(TableAttribute), true);
			
			if (attrs != null && attrs.Length > 0)
			{
				TableAttribute attr = attrs[0];
				
				_schema = attr.Schema;
				_table = attr.Name;
				_projection = attr.Projection;
				_serializerType = attr.Serializer;
			}
			_members = GetMembers(type);
			_keys = _members.Where(a => a.IsKey).AsReadOnly();
		}