Skip to content

NHMA-28 - Annotated NHibernate entity classes can not be processed by Silverlight RIA services. #7

@nhibernate-bot

Description

@nhibernate-bot

Sergey Udovenko created issue - 12/Nov/09 8:20 PM

Silverligh RIA Services internal code generator fails on attempt to process annotated NHibernate entities.

It appears that RIA Services code generator tries to read annotation attributes before the annotation class is properly initialized.

Here is a typical error spot from ClassAttribute.cs (there are many more of them):

public virtual System.Type NameType
{
	get
	{
		return System.Type.GetType( this.Name );
	}
        ...
}

The GetType() method throws a NPE because the Name is null.

A simple fix that worked for me was just to check the name for null value before calling the GetType:

return this.Name != null? System.Type.GetType( this.Name ) : null;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions