コード例 #1
0
        public static PartConventionBuilder <PartConvention> Export(
            this PartConventionBuilder <PartConvention> builder)
        {
            builder.Exports(x => x.Export().Members(m => new[] { m }));

            return(builder);
        }
コード例 #2
0
        public static PartConventionBuilder <PartConvention> ExportAs <T>(
            this PartConventionBuilder <PartConvention> builder)
        {
            builder.Exports(x => x.Export().Members(m => new[] { m }).ContractType <T>());

            return(builder);
        }
コード例 #3
0
        public static PartConventionBuilder <PartConvention> ExportField(
            this PartConventionBuilder <PartConvention> builder, string fieldName)
        {
            if (fieldName == null)
            {
                throw new ArgumentNullException("fieldName");
            }

            builder.Exports(x => x.Export().Members(m => new[] { m.GetField(fieldName) }));

            return(builder);
        }
コード例 #4
0
        public static PartConventionBuilder <PartConvention> ExportProperty(
            this PartConventionBuilder <PartConvention> builder, string propertyName)
        {
            if (propertyName == null)
            {
                throw new ArgumentNullException("propertyName");
            }

            builder.Exports(x => x.Export().Members(m => new[] { m.GetProperty(propertyName) }));

            return(builder);
        }
コード例 #5
0
        public static PartConventionBuilder <PartConvention> ExportProperty <TPart>(
            this PartConventionBuilder <PartConvention> builder, Expression <Func <TPart, object> > expression)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            builder.Exports(x => x.Export().Members(m => new[] { expression.GetTargetMemberInfo() }));

            return(builder);
        }