Beispiel #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);
        }
Beispiel #2
0
        public void Describe(DescribeForms forms) {

            // Describe some standard value types

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

        }
Beispiel #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"));
                });


        }
Beispiel #4
0
 public DescribeForModel(DescribeForms inner) : base(inner)
 {
 }
Beispiel #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;
 }
Beispiel #8
0
 public static DescribeForModelWhere <TModel> ForModelWhere <TModel>(this DescribeForms describe, Func <TModel, bool> predicate)
 {
     return(new DescribeForModelWhere <TModel>(describe, predicate));
 }
Beispiel #9
0
 public static DescribeForModelType ForModelWhereType(this DescribeForms describe, Func <Type, bool> predicate)
 {
     return(new DescribeForModelType(describe, predicate));
 }
Beispiel #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;
 }
Beispiel #12
0
 public void Describe(DescribeForms context) {
     context.ForField("Id").Suppress();
 }