-1

I have just upgraded to the latest version of breeze (1.3.5). I have code that is now failing that was working. The error:

Metadata import failed for /MyApi/PeopleOrg/Metadata; Unable to process returned metadata:Cannot read property 'name' of null

Here is what is returned by the call to get the Metadata (you will need to format this):

{"schema":{"namespace":"LeonardoMD.Server.Api.People.Org","alias":"Self","d4p1:UseStrongSpatialTypes":"false","xmlns:d4p1":"http://schemas.microsoft.com/ado/2009/02/edm/annotation","xmlns":"http://schemas.microsoft.com/ado/2009/11/edm","cSpaceOSpaceMapping":"[[\"LeonardoMD.Server.Api.People.Org.Person\",\"LeonardoMD.Server.Api.People.Org.Person\"],[\"LeonardoMD.Server.Api.People.Org.PersonPhoneNumber\",\"LeonardoMD.Server.Api.People.Org.PersonPhoneNumber\"],[\"LeonardoMD.Server.Api.People.Org.StaffMember\",\"LeonardoMD.Server.Api.People.Org.StaffMember\"],[\"LeonardoMD.Server.Api.People.Org.Contact\",\"LeonardoMD.Server.Api.People.Org.Contact\"]]","entityType":[{"name":"Person","key":{"propertyRef":{"name":"Id"}},"property":[{"name":"Id","type":"Edm.Int32","nullable":"false","d4p1:StoreGeneratedPattern":"Identity"},{"name":"GlobalPersonId","type":"Edm.Int32","nullable":"true"},{"name":"UserId","type":"Edm.Int32","nullable":"true"},{"name":"Inactive","type":"Edm.Boolean","nullable":"false"},{"name":"PrefixId","type":"Edm.Int32","nullable":"true"},{"name":"FirstName","type":"Edm.String","fixedLength":"false","maxLength":"25","unicode":"true","nullable":"true"},{"name":"MiddleName","type":"Edm.String","fixedLength":"false","maxLength":"25","unicode":"true","nullable":"true"},{"name":"LastName","type":"Edm.String","fixedLength":"false","maxLength":"35","unicode":"true","nullable":"true"},{"name":"SuffixId","type":"Edm.Int32","nullable":"true"},{"name":"Email","type":"Edm.String","fixedLength":"false","maxLength":"80","unicode":"true","nullable":"true"},{"name":"Title","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"BirthDate","type":"Edm.DateTime","nullable":"true"},{"name":"SSN","type":"Edm.String","fixedLength":"false","maxLength":"20","unicode":"true","nullable":"true"},{"name":"Alias","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"GenderId","type":"Edm.Int32","nullable":"true"},{"name":"Employer","type":"Edm.String","fixedLength":"false","maxLength":"100","unicode":"true","nullable":"true"},{"name":"Occupation","type":"Edm.String","fixedLength":"false","maxLength":"100","unicode":"true","nullable":"true"},{"name":"NPI","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"NPIGroup","type":"Edm.String","fixedLength":"false","maxLength":"10","unicode":"true","nullable":"true"},{"name":"UPIN","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"TaxIdNumber","type":"Edm.String","fixedLength":"false","maxLength":"80","unicode":"true","nullable":"true"},{"name":"TaxIdTypeId","type":"Edm.Int32","nullable":"true"},{"name":"SpecialtyId","type":"Edm.Int32","nullable":"true"},{"name":"StateLicenseNumber","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"StateLicenseNumberStateId","type":"Edm.Int32","nullable":"true"},{"name":"DEA","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"CommercialNumber","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"CommercialGroupNumber","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"MedicareNumber","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"MedicareGroupNumber","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"MedicaidNumber","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"MedicaidGroupNumber","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"BlueShieldNumber","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"BlueShieldGroupNumber","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"BlueCrossNumber","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"BlueCrossGroupNumber","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"CHAMPUSNumber","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"Comments","type":"Edm.String","fixedLength":"false","maxLength":"3000","unicode":"true","nullable":"true"},{"name":"Verified","type":"Edm.Boolean","nullable":"true"},{"name":"CreateUserId","type":"Edm.Int32","nullable":"true"},{"name":"CreateDate","type":"Edm.DateTime","nullable":"true"},{"name":"ModifyUserId","type":"Edm.Int32","nullable":"true"},{"name":"ModifyDate","type":"Edm.DateTime","nullable":"false"}],"navigationProperty":{"name":"PhoneNumbers","relationship":"Self.Person_PhoneNumbers","fromRole":"Person_PhoneNumbers_Source","toRole":"Person_PhoneNumbers_Target"}},{"name":"PersonPhoneNumber","key":{"propertyRef":[{"name":"PersonId"},{"name":"PhoneTypeId"}]},"property":[{"name":"PersonId","type":"Edm.Int32","nullable":"false"},{"name":"PhoneTypeId","type":"Edm.Int32","nullable":"false"},{"name":"PhoneNumber","type":"Edm.String","fixedLength":"false","maxLength":"70","unicode":"true","nullable":"true"},{"name":"Extension","type":"Edm.String","fixedLength":"false","maxLength":"10","unicode":"true","nullable":"true"},{"name":"OtherDescription","type":"Edm.String","fixedLength":"false","maxLength":"25","unicode":"true","nullable":"true"}]},{"name":"StaffMember","key":{"propertyRef":{"name":"Id"}},"property":[{"name":"Id","type":"Edm.Int32","nullable":"false","d4p1:StoreGeneratedPattern":"Identity"},{"name":"PersonId","type":"Edm.Int32","nullable":"false"},{"name":"Inactive","type":"Edm.Boolean","nullable":"true"},{"name":"StaffMemberTypeId","type":"Edm.Int32","nullable":"true"},{"name":"Provider","type":"Edm.Boolean","nullable":"true"},{"name":"AllowScheduling","type":"Edm.Boolean","nullable":"true"},{"name":"Coordinator","type":"Edm.Boolean","nullable":"true"},{"name":"MobileEmail","type":"Edm.String","fixedLength":"false","maxLength":"80","unicode":"true","nullable":"true"},{"name":"EmailNotificationId","type":"Edm.Int32","nullable":"true"},{"name":"EmailSignature","type":"Edm.String","fixedLength":"false","maxLength":"1000","unicode":"true","nullable":"true"},{"name":"CLIANumber","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"HospiceEmployed","type":"Edm.Boolean","nullable":"true"},{"name":"SignatureOnFile","type":"Edm.Boolean","nullable":"true"},{"name":"Signature","type":"Edm.String","fixedLength":"false","maxLength":"100","unicode":"true","nullable":"true"},{"name":"BillingNameOld","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"BillingEntityTypeId","type":"Edm.Int32","nullable":"true"},{"name":"BillingPrefixId","type":"Edm.Int32","nullable":"true"},{"name":"BillingFirstName","type":"Edm.String","fixedLength":"false","maxLength":"25","unicode":"true","nullable":"true"},{"name":"BillingMiddleName","type":"Edm.String","fixedLength":"false","maxLength":"25","unicode":"true","nullable":"true"},{"name":"BillingLastName","type":"Edm.String","fixedLength":"false","maxLength":"35","unicode":"true","nullable":"true"},{"name":"BillingSuffixId","type":"Edm.Int32","nullable":"true"},{"name":"BillingAddressLine1","type":"Edm.String","fixedLength":"false","maxLength":"55","unicode":"true","nullable":"true"},{"name":"BillingAddressLine2","type":"Edm.String","fixedLength":"false","maxLength":"55","unicode":"true","nullable":"true"},{"name":"BillingCity","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"BillingStateId","type":"Edm.Int32","nullable":"true"},{"name":"BillingState","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"BillingPostalCode","type":"Edm.String","fixedLength":"false","maxLength":"15","unicode":"true","nullable":"true"},{"name":"BillingCountryId","type":"Edm.Int32","nullable":"true"},{"name":"BillingPhoneNumber","type":"Edm.String","fixedLength":"false","maxLength":"70","unicode":"true","nullable":"true"},{"name":"BillingExtension","type":"Edm.String","fixedLength":"false","maxLength":"10","unicode":"true","nullable":"true"},{"name":"PayToSameAsBilling","type":"Edm.Boolean","nullable":"true"},{"name":"PayToEntityTypeId","type":"Edm.Int32","nullable":"true"},{"name":"PayToPrefixId","type":"Edm.Int32","nullable":"true"},{"name":"PayToFirstName","type":"Edm.String","fixedLength":"false","maxLength":"25","unicode":"true","nullable":"true"},{"name":"PayToMiddleName","type":"Edm.String","fixedLength":"false","maxLength":"25","unicode":"true","nullable":"true"},{"name":"PayToLastName","type":"Edm.String","fixedLength":"false","maxLength":"35","unicode":"true","nullable":"true"},{"name":"PayToSuffixId","type":"Edm.Int32","nullable":"true"},{"name":"PayToAddressLine1","type":"Edm.String","fixedLength":"false","maxLength":"55","unicode":"true","nullable":"true"},{"name":"PayToAddressLine2","type":"Edm.String","fixedLength":"false","maxLength":"55","unicode":"true","nullable":"true"},{"name":"PayToCity","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"PayToStateId","type":"Edm.Int32","nullable":"true"},{"name":"PayToState","type":"Edm.String","fixedLength":"false","maxLength":"50","unicode":"true","nullable":"true"},{"name":"PayToPostalCode","type":"Edm.String","fixedLength":"false","maxLength":"15","unicode":"true","nullable":"true"},{"name":"PayToCountryId","type":"Edm.Int32","nullable":"true"},{"name":"PayToPhoneNumber","type":"Edm.String","fixedLength":"false","maxLength":"70","unicode":"true","nullable":"true"},{"name":"PayToExtension","type":"Edm.String","fixedLength":"false","maxLength":"10","unicode":"true","nullable":"true"},{"name":"PayToNPI","type":"Edm.String","fixedLength":"false","maxLength":"11","unicode":"true","nullable":"true"},{"name":"PayToTaxIdNumber","type":"Edm.String","fixedLength":"false","maxLength":"30","unicode":"true","nullable":"true"},{"name":"PayToTaxIdTypeId","type":"Edm.Int32","nullable":"true"},{"name":"VirtuosoEMRGroupId","type":"Edm.Int32","nullable":"true"},{"name":"VirtuosoEMRDefaultLocationId","type":"Edm.Int32","nullable":"true"},{"name":"CreateUserId","type":"Edm.Int32","nullable":"true"},{"name":"CreateDate","type":"Edm.DateTime","nullable":"true"},{"name":"ModifyUserId","type":"Edm.Int32","nullable":"true"},{"name":"ModifyDate","type":"Edm.DateTime","nullable":"true"}]},{"name":"Contact","key":{"propertyRef":{"name":"Id"}},"property":[{"name":"Id","type":"Edm.Int32","nullable":"false","d4p1:StoreGeneratedPattern":"Identity"},{"name":"PersonId","type":"Edm.Int32","nullable":"false"},{"name":"Inactive","type":"Edm.Boolean","nullable":"true"},{"name":"ContactTypeId","type":"Edm.Int32","nullable":"true"},{"name":"PrimaryPhysician","type":"Edm.Boolean","nullable":"true"},{"name":"CreateUserId","type":"Edm.Int32","nullable":"true"},{"name":"CreateDate","type":"Edm.DateTime","nullable":"true"},{"name":"ModifyUserId","type":"Edm.Int32","nullable":"true"},{"name":"ModifyDate","type":"Edm.DateTime","nullable":"true"}]}],"association":{"name":"Person_PhoneNumbers","end":[{"role":"Person_PhoneNumbers_Source","type":"Edm.Self.Person","multiplicity":"1","onDelete":{"action":"Cascade"}},{"role":"Person_PhoneNumbers_Target","type":"Edm.Self.PersonPhoneNumber","multiplicity":"*"}],"referentialConstraint":{"principal":{"role":"Person_PhoneNumbers_Source","propertyRef":{"name":"Id"}},"dependent":{"role":"Person_PhoneNumbers_Target","propertyRef":{"name":"PersonId"}}}},"entityContainer":{"name":"PeopleOrgDbContext","entitySet":[{"name":"People","entityType":"Self.Person"},{"name":"PersonPhoneNumbers","entityType":"Self.PersonPhoneNumber"},{"name":"StaffMembers","entityType":"Self.StaffMember"},{"name":"Contacts","entityType":"Self.Contact"}],"associationSet":{"name":"Person_PhoneNumbers","association":"Self.Person_PhoneNumbers","end":[{"role":"Person_PhoneNumbers_Source","entitySet":"People"},{"role":"Person_PhoneNumbers_Target","entitySet":"PersonPhoneNumbers"}]}}}}

Any idea what could be causing this?

4

2 回答 2

0

我想出了如何解决这个问题,但我不知道为什么需要它。我发现在处理 Person 类和 PersonPhoneNumber 类之间的关联时,微风代码失败了。我在 Person 类的 PhoneNumbers 属性上添加了实体框架 [InverseProperty("Phone")] 属性,并在 PersonPhoneNumber 类的 PersonId 属性上添加了 ForiegnKey("Phone") 指定,并添加了一个新的 Phone 类型的 Phone 属性在 PersonPhoneNumber 类中。

我想得到教训:确保在实体框架模型的两个类中明确定义关联端点。

于 2013-06-12T16:30:13.383 回答
0

当您在导入过程中遇到错误时,导入的元数据是使用先前版本的 Breeze 导出的吗?我问的原因是元数据可能出于各种原因从一个版本更改为另一个版本,其中一个原因是我们正在添加对 NoSQL 的支持并且它们具有新形式的元数据。

如果不是上述情况,您能否提供涉及问题的 2 个实体的定义以及您的导入/导出代码。通过这种方式,我们可以尝试在此处重现问题并进行修复,如果确定这是一个错误。

谢谢。

于 2013-06-12T20:18:47.970 回答