Schema & Namespaces

2 posts, 0 answers
  1. Julio
    Julio avatar
    1 posts
    Member since:
    Oct 2007

    Posted 01 Apr 2012 Link to this post

    There is an option to create our entities classes (tables) using the namespace from the database schemas (i.e. Schema.TableName maps to a class TableName on Schema namespace).

    The problem: only the schema name are being used by the namespace. Example:

    My project is called Project.Foo, so all my classes are inside Project.Foo namespace (or above).
    The created entities are put on a folder with the same name of the database schema, but the namespace does not contains Project.Foo.Schema, only namespace Schema {}

    How to fix it (besides editing the .rlinq xml by hand)?
  2. Viktor Zhivkov
    Viktor Zhivkov avatar
    290 posts

    Posted 05 Apr 2012 Link to this post

    Hi Julio,

    This is a known issue but there is a work around for it.
    You can change the namespace of the domain classes using the Batch Operations Dialog (more about this dialog).
    1. Select all tables that belong to one schema in the grid.
    2. From the Operation combobox on the right select "Change Namespace".
    3. Write the new desired namespace in the New Namespace textbox.
    4. Press the Execute button to apply the change.
    5. Repeat steps from 1 to 4 for each schema.
    6. Save the .rlinq file to trigger the code generation.

    If you update the model from the database the new tables (if any) will require the same process in order to have the desired namespace.
    Changes inside tables won't affect the namespace and tables that have been already fixed using the method above will keep the setting between updates.

    Sorry for the inconvenience caused.

    Kind regards,
    Viktor Zhivkov
    the Telerik team
    Want to use Telerik OpenAccess with SQL Azure? Download the trial version today. 
  3. DevCraft banner
Back to Top