Esempio n. 1
0
        private void MapItem(IList <MappingConfiguration> mappings)
        {
            var itemMapping = new MappingConfiguration <RealEstateItem>();

            itemMapping.HasProperty(p => p.Id).IsIdentity();
            itemMapping.MapType(p => new { }).ToTable("sfex_realestate_item");

            itemMapping.HasProperty(p => p.ItemNumber);
            itemMapping.HasProperty(p => p.Address);
            itemMapping.HasProperty(p => p.PostalCode);
            itemMapping.HasProperty(p => p.Housing);
            itemMapping.HasProperty(p => p.NumberOfRooms);
            itemMapping.HasProperty(p => p.NumberOfFloors);
            itemMapping.HasProperty(p => p.YearBuilt);
            itemMapping.HasProperty(p => p.Price);
            itemMapping.HasProperty(p => p.Payment);
            itemMapping.HasProperty(p => p.MonthlyRate);
            itemMapping.HasProperty(p => p.Net);
            itemMapping.HasProperty(p => p.PriceSquareMeter);
            itemMapping.HasProperty(p => p.Latitude);
            itemMapping.HasProperty(p => p.Longitude);
            itemMapping.HasProperty(p => p.AgentId);


            itemMapping.HasAssociation <Telerik.Sitefinity.Security.Model.Permission>(p => p.Permissions);
            itemMapping.HasProperty(p => p.InheritsPermissions);
            itemMapping.HasAssociation <Telerik.Sitefinity.Security.Model.PermissionsInheritanceMap>(p => p.PermissionChildren);
            itemMapping.HasProperty(p => p.CanInheritPermissions);
            itemMapping.HasAssociation(p => p.Urls).WithOppositeMember("parent", "Parent").ToColumn("content_id").IsDependent().IsManaged();
            CommonFluentMapping.MapILifecycleDataItemFields <RealEstateItem>(itemMapping, this.Context);
            mappings.Add(itemMapping);
        }
        private void MapItem(IList <MappingConfiguration> mappings)
        {
            var itemMapping = new MappingConfiguration <ProductItem>();

            itemMapping.HasProperty(p => p.Id).IsIdentity();
            itemMapping.MapType(p => new { }).ToTable("custom_products");
            itemMapping.HasProperty(p => p.Price);
            itemMapping.HasProperty(p => p.QuantityInStock);
            itemMapping.HasAssociation <Telerik.Sitefinity.Security.Model.Permission>(p => p.Permissions);
            itemMapping.HasProperty(p => p.InheritsPermissions);
            itemMapping.HasProperty(p => p.CanInheritPermissions);
            itemMapping.HasAssociation(p => p.Urls).WithOppositeMember("parent", "Parent").ToColumn("content_id").IsDependent().IsManaged();

            //map language data & published translations
            CommonFluentMapping.MapILifecycleDataItemFields <ProductItem>(itemMapping, this.Context);
            mappings.Add(itemMapping);
        }
        private void MapItem(IList <MappingConfiguration> mappings)
        {
            var itemMapping = new MappingConfiguration <AgentItem>();

            itemMapping.HasProperty(p => p.Id).IsIdentity();
            itemMapping.MapType(p => new { }).ToTable("sfex_agent_item");

            itemMapping.HasProperty(p => p.Email);
            itemMapping.HasProperty(p => p.PhoneNumber);
            itemMapping.HasProperty(p => p.Address);
            itemMapping.HasProperty(p => p.PostalCode);

            itemMapping.HasAssociation <Telerik.Sitefinity.Security.Model.Permission>(p => p.Permissions);
            itemMapping.HasProperty(p => p.InheritsPermissions);
            itemMapping.HasAssociation <Telerik.Sitefinity.Security.Model.PermissionsInheritanceMap>(p => p.PermissionChildren);
            itemMapping.HasProperty(p => p.CanInheritPermissions);
            itemMapping.HasAssociation(p => p.Urls).WithOppositeMember("parent", "Parent").ToColumn("content_id").IsDependent().IsManaged();
            CommonFluentMapping.MapILifecycleDataItemFields <AgentItem>(itemMapping, this.Context);

            mappings.Add(itemMapping);
        }