Example #1
0
        public static DescribeForms ForModel <TModel>(this DescribeForms describe, Action <DescribeForModel <TModel> > action)
        {
            var dfm = new DescribeForModel <TModel>(describe);

            action.Invoke(dfm);
            return(describe);
        }
Example #2
0
        public void Describe(DescribeForms forms) {

            // Describe some standard value types

            //forms.ForValue<String>()
             //   .Map(s => new StringField(s)).Unmap(f => f.Value);

        }
Example #3
0
        public void Describe(DescribeForms context) {

            context.ForModel<SpecialOffer>(
                f => {
                    // Suppress start/end dates
                    f.ForField(m => m.StartDate).Suppress();
                    f.ForField(m => m.EndDate).Suppress();
           //         f.AddField("AppliesOn", 
             //           m => new DateRange(m.StartDate, m.EndDate),
               //         on=>on.Meta("Date range during which the offer takes effect"));
                });


        }
Example #4
0
 public DescribeForModel(DescribeForms inner) : base(inner)
 {
 }
Example #5
0
 public DescribeModel(DescribeForms inner)
 {
     InnerDescribe = inner;
 }
 public DescribeForModelType(DescribeForms describe, Func<Type, bool> predicate) : base(describe) {
     this.predicate = predicate;
 }
 public DescribeForModelWhere(DescribeForms describe, Func <TModel, bool> predicate) : base(describe)
 {
     this.predicate = predicate;
 }
Example #8
0
 public static DescribeForModelWhere <TModel> ForModelWhere <TModel>(this DescribeForms describe, Func <TModel, bool> predicate)
 {
     return(new DescribeForModelWhere <TModel>(describe, predicate));
 }
Example #9
0
 public static DescribeForModelType ForModelWhereType(this DescribeForms describe, Func <Type, bool> predicate)
 {
     return(new DescribeForModelType(describe, predicate));
 }
Example #10
0
 public static DescribeForModel <TModel> ForModel <TModel>(this DescribeForms describe)
 {
     return(new DescribeForModel <TModel>(describe));
 }
 public DescribeForModelType(DescribeForms describe, Func <Type, bool> predicate) : base(describe)
 {
     this.predicate = predicate;
 }
Example #12
0
 public void Describe(DescribeForms context) {
     context.ForField("Id").Suppress();
 }