"景先生毕设|www.jxszl.com

C# BuildContext类代码示例

2023-12-29 17:36编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中BuildContext类的典型用法代码示例。如果您正苦于以下问题:C#BuildContext类的具体用法?C#BuildContext怎么用?C#BuildContext使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:PostBelongsToBlog publicvoidPostBelongsToBlog() { InitKernel(); IRelationshipInferenceServicerelService=ObtainService(); TableDefinitionblogTable; TableDefinitionpostTable; BuildBlogPostsStructure(outblogTable,outpostTable); BuildContextcontext=newBuildContext(); ActiveRecordDescriptorarDesc=newActiveRecordDescriptor(); ActiveRecordPropertyDescriptor[]descs=relService.InferRelations(arDesc,postTable,context); Assert.IsNotNull(descs); Assert.AreEqual(1,descs.Length); ActiveRecordBelongsToDescriptordesc1=descs[0]asActiveRecordBelongsToDescriptor; Assert.IsNotNull(desc1); Assert.IsNotNull(desc1.TargetType); Assert.IsNull(desc1.PropertyType); Assert.AreEqual("Blog",desc1.PropertyName); Assert.AreEqual("blog_id",desc1.ColumnName); ActiveRecordDescriptortargetARDescriptor=context.GetNextPendent(); Assert.AreSame(blogTable,targetARDescriptor.Table); }
原文链接:http://www.jxszl.com/biancheng/C/556598.html