当前位置: 首页>>代码示例>>C#>>正文


C# MappingConfiguration.MapType方法代码示例

本文整理汇总了C#中MappingConfiguration.MapType方法的典型用法代码示例。如果您正苦于以下问题:C# MappingConfiguration.MapType方法的具体用法?C# MappingConfiguration.MapType怎么用?C# MappingConfiguration.MapType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MappingConfiguration的用法示例。


在下文中一共展示了MappingConfiguration.MapType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapUrlData

 /// <summary>
 /// Maps the ProjectItemUrlData class
 /// </summary>
 /// <param name="mappings">The LocatoinItemUrlData class mappings.</param>
 private void MapUrlData(IList<MappingConfiguration> mappings)
 {
     // map the Url data type
     var urlDataMapping = new MappingConfiguration<ProjectItemUrlData>();
     urlDataMapping.MapType(p => new { }).Inheritance(InheritanceStrategy.Flat).ToTable("sf_url_data");
     mappings.Add(urlDataMapping);
 }
开发者ID:eulalie367,项目名称:littleapps,代码行数:11,代码来源:FluentMapping.cs

示例2: CreateQuestionMapping

        private MappingConfiguration<Question> CreateQuestionMapping()
        {
            MappingConfiguration<Question> questionMapping = new MappingConfiguration<Question>();
            questionMapping.MapType(question => new
            {
                QuestionId = question.Id,
                QueryText = question.QueryText,
                PostedById = question.PostedById
            })
            .ToTable("Questions");
            questionMapping.HasProperty(q => q.Id).IsIdentity();
            questionMapping.HasAssociation(q => q.PostedBy)
                .WithOpposite(u => u.CreatedQuestions)
                .HasConstraint((q, u) => q.PostedById == u.Id);
            questionMapping.HasAssociation(q => q.UsersThatVoted)
                .WithOpposite(u => u.VotedOnQuestions)
                .IsManaged()
                .MapJoinTable("QuestionsUsers", (q, u) => new 
                    {
                        QuestionGuid = q.Id,
                        UserGuid = u.Id
                    });
            questionMapping.HasAssociation(q => q.Answers)
                .WithOpposite(a => a.Question)
                .HasConstraint((q, a) => q.Id == a.QuestionId)
                .IsManaged();

            return questionMapping;
        }
开发者ID:BPalagachev,项目名称:PollSystem,代码行数:29,代码来源:IdentityModelMetadataSource.cs

示例3: TeamMapping

        private MappingConfiguration TeamMapping()
        {
            var mapping = new MappingConfiguration<Team>();

            mapping.MapType()
                   .ToTable("Team");

            mapping.HasProperty(m => m.Id)
                   .IsIdentity(KeyGenerator.Autoinc);

            mapping.HasProperty(m => m.IsOpen)
                   .HasColumnType("bit");

            mapping.HasAssociation(m => m.Owner)
                   .IsManaged()
                   .ToColumn("OwnerId");

            mapping.HasAssociation(m => m.Things)
                   .IsManaged()
                   .ToColumn("TeamId");

            mapping.HasAssociation(m => m.Members)
                   .WithOpposite(t => t.Team)
                   .IsManaged()
                   .IsDependent()
                   .ToColumn("TeamId");

            return mapping;
        }
开发者ID:jessemlay,项目名称:TeamThing,代码行数:29,代码来源:TeamThingMetadataSource.cs

示例4: PrepareMapping

        protected override IList<MappingConfiguration> PrepareMapping()
        {
            List<MappingConfiguration> configurations = new List<MappingConfiguration>();

            var saleMapping = new MappingConfiguration<Sale>();
           saleMapping.MapType(sale => new
            {
                ID = sale.Id,
                Dish = sale.Dish,
                Quantity = sale.Quantity,
                Month = sale.Month,
                Year = sale.Year
            }).ToTable("Sale");
            saleMapping.HasProperty(s => s.Id).IsIdentity();

            configurations.Add(saleMapping);

            var dishReportMapping = new MappingConfiguration<DishReport>();
            dishReportMapping.MapType(report => new
            {
                Month = report.Month,
                DeliveredPrice = report.DeliveredPrice,
                SoldPrice = report.SoldPrice,
                Code = report.Code,
            }).ToTable("DishReport");
            saleMapping.HasProperty(s => s.Id).IsIdentity();

            configurations.Add(dishReportMapping);

            return configurations;
        }
开发者ID:ScreeM92,项目名称:Software-University,代码行数:31,代码来源:CentaurFactoryModelMetadataSource.cs

示例5: GetRentalRateClassConfiguration

		public MappingConfiguration<RentalRate> GetRentalRateClassConfiguration()
		{
			MappingConfiguration<RentalRate> configuration = new MappingConfiguration<RentalRate>();
			configuration.MapType(x => new { }).WithConcurencyControl(OptimisticConcurrencyControlStrategy.Changed).ToTable("RentalRates");
		
			return configuration;
		}
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:7,代码来源:EntitiesModelFluentMetadataSource.cs

示例6: GetTeamClassConfiguration

		public MappingConfiguration<Team> GetTeamClassConfiguration()
		{
			MappingConfiguration<Team> configuration = new MappingConfiguration<Team>();
			configuration.MapType().WithDataAccessKind(DataAccessKind.ReadWrite);
		
			return configuration;
		}
开发者ID:Go9Rhodes,项目名称:TeamThing,代码行数:7,代码来源:TeamThingModelFluentMetadataSource.cs

示例7: PrepareMapping

        protected override IList<MappingConfiguration> PrepareMapping()
        {
            List<MappingConfiguration> configurations = new List<MappingConfiguration>();

            MappingConfiguration<Report> reportConfiguration = new MappingConfiguration<Report>();

            reportConfiguration.MapType(x => new
            {
                ID = x.Id,
                Name = x.Name,
                Duration = x.Duration,
                Destination = x.Destination,
                ClientsCount = x.ClientsCount,
                TotalIncome = x.TotalIncome,
                TransportCompany = x.TransportCompany,
                TransportType = x.TransportType,
                GuideName = x.GuideName,
                ExpenseId = x.ExpenseId
            }).ToTable("Reports");

            reportConfiguration.HasProperty(p => p.Id).IsIdentity(KeyGenerator.Autoinc);

            configurations.Add(reportConfiguration);

            return configurations;
        }
开发者ID:DataBaseTeamSilver,项目名称:Travel-Agency,代码行数:26,代码来源:ReportsFluentSource.cs

示例8: GetJobScheduleClassConfiguration

        public MappingConfiguration<JobSchedule> GetJobScheduleClassConfiguration()
        {
            var configuration = new MappingConfiguration<JobSchedule>();
            configuration.MapType(x => new { })
                         .WithConcurencyControl(Changed)
                         .ToTable("js_JobSchedules");

            return configuration;
        }
开发者ID:KatoTek,项目名称:Jobs,代码行数:9,代码来源:EntitiesModelFluentMetadataSource.cs

示例9: MapFileData

        /// <summary>
        /// Maps the file data.
        /// </summary>
        /// <param name="mappings">The mappings.</param>
        private void MapFileData(List<MappingConfiguration> mappings)
        {
            var fileDataMapping = new MappingConfiguration<FileData>();

            fileDataMapping.MapType(p => new { }).WithConcurencyControl(OptimisticConcurrencyControlStrategy.None).ToTable("sf_files_monitor_data");
            fileDataMapping.HasProperty(p => p.Id).IsIdentity();
            fileDataMapping.HasProperty(p => p.FileName).ToColumn("file_name");
            fileDataMapping.HasProperty(p => p.FilePath).ToColumn("file_path");
            fileDataMapping.HasProperty(p => p.PackageName).ToColumn("package_name");

            mappings.Add(fileDataMapping);
        }
开发者ID:vkoppaka,项目名称:feather,代码行数:16,代码来源:FileMonitorFluentMapping.cs

示例10: CreateIdentityRoleMapping

        private MappingConfiguration<IdentityRole> CreateIdentityRoleMapping()
        {
            MappingConfiguration<IdentityRole> identityRoleMapping = new MappingConfiguration<IdentityRole>();
            identityRoleMapping.MapType(role => new 
            {
                id = role.Id,
                Name = role.Name
            }).ToTable("IdentityRoles");
            identityRoleMapping.HasProperty(x => x.Id).IsIdentity();

            return identityRoleMapping;
        }
开发者ID:BPalagachev,项目名称:PollSystem,代码行数:12,代码来源:IdentityModelMetadataSource.cs

示例11: CraeteIdentityUserMapping

        private MappingConfiguration<IdentityUser> CraeteIdentityUserMapping()
        {
            MappingConfiguration<IdentityUser> identityUserMapping = new MappingConfiguration<IdentityUser>();
            identityUserMapping.MapType(user => new 
            {
                Id = user.Id,
                Name = user.UserName, 
                PasswordHash = user.PasswordHash
            }).ToTable("IdentityUsers");
            identityUserMapping.HasProperty(x => x.Id).IsIdentity();

            return identityUserMapping;
        }
开发者ID:BPalagachev,项目名称:PollSystem,代码行数:13,代码来源:IdentityModelMetadataSource.cs

示例12: GetTable

 private MappingConfiguration<CLASSNAME> GetTable()
 {
     MappingConfiguration<Position> configuration = new MappingConfiguration<CLASSNAME>();
     configuration.MapType()
                  .Inheritance(Telerik.OpenAccess.InheritanceStrategy.Flat)
                  .WithConcurencyControl(OptimisticConcurrencyControlStrategy.Version);
     configuration.HasProperty(x => x.Id).IsIdentity(KeyGenerator.Autoinc);
     //configuration.HasIndex(x => new {
     //   x.Price,
     //   x.ProductName
     //}).IsUnique()
     //.IsClustered()
     return configuration;
 }
开发者ID:lubushyn,项目名称:DataAccessHelper,代码行数:14,代码来源:OpenAccessMetadataSource.cs

示例13: PrepareMapping

        protected override IList<MappingConfiguration> PrepareMapping()
        {
            List<MappingConfiguration> configurations = new List<MappingConfiguration>();

            var stefan = new MappingConfiguration<Stefan>();
            stefan.MapType(s => new
            {
                ID = s.StefanID,
                Name = s.Name,
            }).ToTable("Stefan");
            stefan.HasProperty(s => s.StefanID).IsIdentity();
            configurations.Add(stefan);

            return configurations;
        }
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:15,代码来源:FluentModelMetadataSource.cs

示例14: GetMapping

 public static MappingConfiguration GetMapping()
 {
     var mapping = new MappingConfiguration<Instance>();
     mapping.MapType().ToTable("Instances");
     mapping.HasProperty(p => p.SurrogateInstanceId).IsIdentity(KeyGenerator.Autoinc);
     mapping.HasProperty(p => p.PrimitiveDataProperties).WithInfiniteLength().IsNullable();
     mapping.HasProperty(p => p.ComplexDataProperties).WithInfiniteLength().IsNullable();
     mapping.HasProperty(p => p.WriteOnlyPrimitiveDataProperties).WithInfiniteLength().IsNullable();
     mapping.HasProperty(p => p.WriteOnlyComplexDataProperties).WithInfiniteLength().IsNullable();
     mapping.HasProperty(p => p.MetadataProperties).WithInfiniteLength().IsNullable();
     mapping.HasProperty(p => p.SuspensionExceptionName).WithVariableLength(450).IsNullable().IsUnicode();
     mapping.HasProperty(p => p.SuspensionReason).WithInfiniteLength().IsUnicode().IsNullable();
     mapping.HasProperty(p => p.BlockingBookmarks).WithInfiniteLength().IsUnicode().IsNullable();
     mapping.HasProperty(p => p.LastMachineRunOn).WithVariableLength(450).IsUnicode().IsNullable();
     return mapping;
 }
开发者ID:jhuntsman,项目名称:EasyNetQ.Wf,代码行数:16,代码来源:Instance.cs

示例15: MapItem

        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);
		}
开发者ID:jrcollado1987,项目名称:Telerik.Sitefinity.Samples.Products,代码行数:16,代码来源:ProductsFluentMapping.cs


注:本文中的MappingConfiguration.MapType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。