Esempio n. 1
0
 public override void Map(BsonClassMap <Input> cm)
 {
     cm.AutoMap();
     cm.MapField("_tags").SetElementName("Tags");
     cm.MapField("_images").SetElementName("Images");
     cm.MapField("_videos").SetElementName("Videos");
     cm.MapField("_inputAttributes").SetElementName("InputAttributes");
 }
 public override void Map(BsonClassMap <Validation> cm)
 {
     cm.AutoMap();
     cm.MapField("_tags").SetElementName("Tags");
     cm.MapField("_images").SetElementName("Images");
     cm.MapField("_videos").SetElementName("Videos");
     cm.MapField("_validationAttributes").SetElementName("ValidationAttributes");
 }
        public override void Map(BsonClassMap <AggregateRoot> config)
        {
            config.MapField("_createdBy").SetElementName("CreatedBy");
            config.MapField("_createdAt").SetElementName("CreatedAt")
            .SetSerializer(new DateTimeSerializer(DateTimeKind.Local));

            config.MapField("_updatedBy").SetElementName("UpdatedBy");
            config.MapField("_updatedAt").SetElementName("UpdatedAt")
            .SetSerializer(new DateTimeSerializer(DateTimeKind.Local));
        }
        public override void Map(BsonClassMap <Campaign> config)
        {
            config.AutoMap();
            config.SetIgnoreExtraElements(true);

            config.MapField("_name").SetElementName("Name");
            config.MapField("_startsAt").SetElementName("StartsAt")
            .SetSerializer(new DateTimeSerializer(DateTimeKind.Local));
            config.MapField("_completesAt").SetElementName("CompletesAt")
            .SetSerializer(new DateTimeSerializer(DateTimeKind.Local));
        }
Esempio n. 5
0
        public override void Map(BsonClassMap <ReceiptItem> config)
        {
            config.AutoMap();
            config.SetIgnoreExtraElements(true);

            config.MapField("_title").SetElementName("Title");
            config.MapField("_description").SetElementName("Description");
            config.MapField("_price").SetElementName("Price")
            .SetSerializer(new DecimalSerializer(BsonType.Decimal128));
            config.MapField("_quantity").SetElementName("Quantity");
        }
Esempio n. 6
0
        public override void Map(BsonClassMap <Receipt> config)
        {
            config.AutoMap();
            config.SetIgnoreExtraElements(true);

            config.MapField("_date").SetElementName("Date")
            .SetSerializer(new DateTimeSerializer(DateTimeKind.Local));
            config.MapField("_description").SetElementName("Description");
            config.MapField("_campaignId").SetElementName("CampaignId");
            config.MapField("_receiptItems").SetElementName("ReceiptItems");
            config.MapField("_tags").SetElementName("Tags");
        }
Esempio n. 7
0
 public override void Map(BsonClassMap <TeamClass> cm)
 {
     cm.AutoMap();
     cm.MapField("_operations").SetElementName("Operations");
     cm.MapField("_sources").SetElementName("Sources");
     cm.MapField("_sites").SetElementName("Sites");
     cm.MapField("_operationalDepartments").SetElementName("OperationalDepartments");
     cm.MapField("_zones").SetElementName("Zones");
     cm.MapField("_typePlannings").SetElementName("TypePlannings");
     cm.MapField("_customers").SetElementName("Customers");
     cm.MapField("_productionSites").SetElementName("ProductionSites");
     cm.MapField("_transportTypes").SetElementName("TransportTypes");
     cm.MapField("_teamOperators").SetElementName("TeamOperators");
 }
Esempio n. 8
0
        public static void MapAsRef <TClass, TMember>(this BsonClassMap <TClass> map, Expression <Func <TClass, TMember> > property, string acessor, Action <IRefMapper <TMember> > mapping) where TClass : class where TMember : class
        {
            var base_member = map.MapField(acessor);

            base_member.SetElementName(ReflectionTools.GetPropertyInfo(property).Name);
            mapping(new RefMapper <TClass, TMember>(base_member));
        }
        public void SetupBsonMapping(BsonClassMap <SRecipe> document)
        {
            document.AutoMap();

            document.MapField(x => x.Image);

            // Use the id for the auto-generated db id.
            // Reserve the identifier field for the original url of the schema object.
            document.MapIdField(x => x.Id);
        }
Esempio n. 10
0
        protected override void Configure(BsonClassMap <Order> builder)
        {
            builder.MapProperty(x => x.Identifier);
            builder.MapProperty(x => x.Price);
            builder.MapProperty(x => x.Description);
            builder.MapProperty(x => x.Status);

            builder.MapProperty(x => x.SenderLocation);
            builder.MapProperty(x => x.RecipientLocation);
            builder.MapProperty(x => x.CurrentLocation);

            builder.MapField("_cargos").SetElementName(nameof(Order.Cargos));
        }
        public void Apply(BsonClassMap classMap)
        {
            var readOnlyProperties = classMap
                                     .ClassType
                                     .GetTypeInfo()
                                     .GetProperties(_bindingFlags)
                                     .Where(propInfo => IsReadOnlyProperty(classMap, propInfo))
                                     .ToList();

            foreach (var property in readOnlyProperties)
            {
                classMap.MapMember(property);
            }

            if (classMap.ClassType.Name.Equals("Event"))
            {
                classMap.MapField("_version");
                classMap.MapProperty("Version");
            }
        }
Esempio n. 12
0
 public override void Map(BsonClassMap <Operation> cm)
 {
     cm.AutoMap();
     cm.MapField("_tags").SetElementName("Tags");
 }
Esempio n. 13
0
 public override void Map(BsonClassMap <Source> cm)
 {
     cm.AutoMap();
     cm.MapField("_sourceBusinessUnits").SetElementName("SourceBusinessUnits");
 }
Esempio n. 14
0
 public static void MapPropertyField <TClass>(this BsonClassMap <TClass> map, string name)
 {
     map.MapField(name.ToFieldName()).SetElementName(name);
 }
Esempio n. 15
0
 public override void Map(BsonClassMap <Question> cm)
 {
     cm.AutoMap();
     cm.MapField("_answers").SetElementName("Answers");
 }
Esempio n. 16
0
 public override void Map(BsonClassMap <Remark> cm)
 {
     cm.AutoMap();
     cm.MapField("_defaultRemarks").SetElementName("DefaultRemarks");
     cm.MapField("_tags").SetElementName("Tags");
 }
 public void SetupBsonMapping(BsonClassMap <JsonLdObject> document)
 {
     document.MapField(x => x.Context).SetElementName("@context");
     document.MapField(x => x.Type).SetElementName("@type");
     document.MapField(x => x.Id).SetElementName("id");
 }
Esempio n. 18
0
 public override void Map(BsonClassMap <Checklist> cm)
 {
     cm.AutoMap();
     cm.MapField("_tags").SetElementName("Tags");
     cm.MapField("_questions").SetElementName("Questions");
 }