Esempio n. 1
0
 public void Map(ITypeMappingConfigurator <StringToObjectDictionaryContainer> map)
 {
     // SAMPLE: map-property-as-attributes
     map.Include(x => x.Map, o => o.AsAttributes());
     // ENDSAMPLE
     map.Include(x => x.ETag, o => o.AsEtag());
 }
Esempio n. 2
0
        // ENDSAMPLE

        #endregion

        #region sample

        // SAMPLE: misc-include-property-onget-onset-onquery
        public void IncludePropertyWithCustomAccessors(ITypeMappingConfigurator <Customer> customer)
        {
            customer
            .Include(x => x.Name, x => x
                     .OnGet(y => y.Name.ToUpper())
                     .OnSet((c, v) => c.Name = v.ToLower())
                     .OnQuery(y => y.Name.ToUpper()));
        }
Esempio n. 3
0
 public void Map(ITypeMappingConfigurator <VirtualPropertyThing> map)
 {
     map
     .Include <string>("Rocky",
                       o => o.OnGetAndQuery(x => x.Items.SafeGet("Rocky") ?? "BALOBA")
                       .OnSet((x, v) => x.Items["Rocky"] = v)
                       .Writable())
     .Include <double>("NumberSquareRoot",
                       o => o.OnGetAndQuery(x => Math.Sqrt(x.Number))
                       .OnSet((x, v) => x.Number = v * v)
                       .Writable());
 }
Esempio n. 4
0
            public void Map(ITypeMappingConfigurator <TestEntityBase> map)
            {
                map.Include(x => x.Id);
                map.Include(x => x.ToBeOverridden);

                switch (this.defaultPropertyInclusionMode)
                {
                case null:
                    break;

                case DefaultPropertyInclusionMode.AllPropertiesRequiresExplicitMapping:
                    map.AllPropertiesRequiresExplicitMapping();
                    break;

                case DefaultPropertyInclusionMode.AllPropertiesAreIncludedByDefault:
                    map.AllPropertiesAreIncludedByDefault();
                    break;

                case DefaultPropertyInclusionMode.AllPropertiesAreExcludedByDefault:
                    map.AllPropertiesAreExcludedByDefault();
                    break;
                }
            }
Esempio n. 5
0
 public void Map(ITypeMappingConfigurator <DictionaryContainer> map)
 {
     map.Include(x => x.Map, o => o.AsAttributes());
 }
Esempio n. 6
0
        // ENDSAMPLE

        #endregion

        #region sample

        // SAMPLE: misc-include-property-named
        public void IncludePropertyNamed(ITypeMappingConfigurator <Customer> customer)
        {
            customer.Include(x => x.Identifier, x => x.Named("Id"));
        }
Esempio n. 7
0
 public void Map(ITypeMappingConfigurator<Customer> map)
 {
     map.Exclude(x => x.Password);
     map.Include(x => x.Name);
     map.Include(x => x.Identifier, o => o.AsPrimaryKey());
 }
Esempio n. 8
0
        // ENDSAMPLE

        #endregion

        #region sample

        // SAMPLE: misc-expand-property
        public void ExpandProperty(ITypeMappingConfigurator <Customer> customer)
        {
            customer
            .Include(x => x.Address, x => x.Expand(ExpandMode.Full));
        }
Esempio n. 9
0
        // ENDSAMPLE

        #endregion

        #region sample

        // SAMPLE: misc-include-property-onget-onset-onquery
        public void IncludePropertyWithCustomAccessors(ITypeMappingConfigurator<Customer> customer)
        {
            customer
                .Include(x => x.Name, x => x
                    .OnGet(y => y.Name.ToUpper())
                    .OnSet((c, v) => c.Name = v.ToLower())
                    .OnQuery(y => y.Name.ToUpper()));
        }
Esempio n. 10
0
        // ENDSAMPLE

        #endregion

        #region sample

        // SAMPLE: misc-expand-property
        public void ExpandProperty(ITypeMappingConfigurator<Customer> customer)
        {
            customer
                .Include(x => x.Address, x => x.Expand(ExpandMode.Full));
        }
Esempio n. 11
0
 public void Map(ITypeMappingConfigurator <HasReadOnlyDictionaryProperty> map)
 {
     map.Include(x => x.Map,
                 o =>
                 o.AsAttributes().WithAccessMode(HttpMethod.Get | HttpMethod.Patch | HttpMethod.Post));
 }
Esempio n. 12
0
 public void Map(ITypeMappingConfigurator<DictionaryContainer> map)
 {
     map.Include(x => x.Map, o => o.AsAttributes());
 }
Esempio n. 13
0
 public void Map(ITypeMappingConfigurator<ThingWithRenamedProperties> map)
 {
     map.Include(x => x.Junky, o => o.Named("DiscoFunky"));
     map.Include(x => x.RelatedJunks, o => o.Named("PrettyThings"));
 }
Esempio n. 14
0
 public void Map(ITypeMappingConfigurator<StringToObjectDictionaryContainer> map)
 {
     // SAMPLE: map-property-as-attributes
     map.Include(x => x.Map, o => o.AsAttributes());
     // ENDSAMPLE
     map.Include(x => x.ETag, o => o.AsEtag());
 }
Esempio n. 15
0
 public void Map(ITypeMappingConfigurator<JunkWithRenamedProperty> map)
 {
     map.Include(x => x.ReallyUglyPropertyName, o => o.Named("BeautifulAndExposed"));
 }
Esempio n. 16
0
 public void Map(ITypeMappingConfigurator <Top> map)
 {
     map.OnDeserialized(x => x.DeserializeHookWasRun = true);
     map.Include(x => x.ToBeRenamed, o => o.Named("NewName"));
 }
Esempio n. 17
0
 public void Map(ITypeMappingConfigurator <ThingWithRenamedProperties> map)
 {
     map.Include(x => x.Junky, o => o.Named("DiscoFunky"));
     map.Include(x => x.RelatedJunks, o => o.Named("PrettyThings"));
 }
Esempio n. 18
0
 public void Map(ITypeMappingConfigurator <AbstractAnimal> map)
 {
     map.Include(x => x.PublicAndReadOnlyThroughApi, o => o.ReadOnly());
 }
Esempio n. 19
0
 public void Map(ITypeMappingConfigurator<VirtualPropertyThing> map)
 {
     map
         .Include<string>("Rocky",
                          o => o.OnGetAndQuery(x => x.Items.SafeGet("Rocky") ?? "BALOBA")
                                .OnSet((x, v) => x.Items["Rocky"] = v)
                                .Writable())
         .Include<double>("NumberSquareRoot",
                          o => o.OnGetAndQuery(x => Math.Sqrt(x.Number))
                                .OnSet((x, v) => x.Number = v * v)
                                .Writable());
 }
Esempio n. 20
0
 public void Map(ITypeMappingConfigurator <Critter> map)
 {
     map.Include(x => x.PublicAndReadOnlyThroughApi, o => o.ReadOnly());
 }
Esempio n. 21
0
 // SAMPLE: etag-fluent-rule
 public void Map(ITypeMappingConfigurator <EtaggedEntity> map)
 {
     map.Include(x => x.ETag, o => o.AsEtag());
 }
Esempio n. 22
0
 public void Map(ITypeMappingConfigurator<HasReadOnlyDictionaryProperty> map)
 {
     map.Include(x => x.Map,
                 o =>
                     o.AsAttributes().WithAccessMode(HttpMethod.Get | HttpMethod.Patch | HttpMethod.Post));
 }
Esempio n. 23
0
 public void Map(ITypeMappingConfigurator <JunkWithRenamedProperty> map)
 {
     map.Include(x => x.ReallyUglyPropertyName, o => o.Named("BeautifulAndExposed"));
 }
Esempio n. 24
0
 // SAMPLE: etag-fluent-rule
 public void Map(ITypeMappingConfigurator<EtaggedEntity> map)
 {
     map.Include(x => x.ETag, o => o.AsEtag());
 }
Esempio n. 25
0
        // ENDSAMPLE

        #endregion

        #region sample

        // SAMPLE: misc-include-property-named
        public void IncludePropertyNamed(ITypeMappingConfigurator<Customer> customer)
        {
            customer.Include(x => x.Identifier, x => x.Named("Id"));
        }
Esempio n. 26
0
 public void Map(ITypeMappingConfigurator<AbstractAnimal> map)
 {
     map.Include(x => x.PublicAndReadOnlyThroughApi, o => o.ReadOnly());
 }
Esempio n. 27
0
 public void Map(ITypeMappingConfigurator<Critter> map)
 {
     map.Include(x => x.PublicAndReadOnlyThroughApi, o => o.ReadOnly());
 }
Esempio n. 28
0
 public void Map(ITypeMappingConfigurator <Customer> map)
 {
     map.Exclude(x => x.Password);
     map.Include(x => x.Name);
     map.Include(x => x.Identifier, o => o.AsPrimaryKey());
 }