Assembler and transport generation. Sqlite

4 posts, 2 answers
  1. Jose Mejia
    Jose  Mejia avatar
    107 posts
    Member since:
    May 2009

    Posted 03 Dec 2012 Link to this post

    Hello.

    I've  got two questions:

    1) I'm using generated assembler and transport code. I generate them throught Sevice Wizard. The problem is that I've to hold empty
    WCF project to store generated files. And then manually copy/paste to assembler and transport files in my project. Is there more convinient way to accomplish this task? For example, when I change my model I then click somewhere  to generate need files and point to where to store them. Maybe you have some useful scripts for that stuff?

    2) Do you plan to support new .net Sqlite data provider 1.0.82.0? The lates version OA supports is 1.0.76.0.

    Thanks in advance.
  2. Answer
    Hristo Marinov
    Admin
    Hristo Marinov avatar
    13 posts

    Posted 06 Dec 2012 Link to this post

    Hello Jose,

    Regarding your first question - when you open the ‘Add OpenAccess Service Wizard’ the first window that appears is ‘Select Source and Output’. From here you can not only select which context will be used when creating the service but also in which service project the .svc file will be stored and where the service code base will reside.

    In order not to copy the generated files manually, in the Service Code Base section -> Use Existing Project drop-down choose your project where ou want your generated files to be stored, or choose the Create Project option, which will create a new Class Library project with the specified name and store the files there.

    Here you can find more information about the 'Add OpenAccess Service Wizard'.

    Regarding your second question - the current version of System.Data.SQLite.dll that we use is 1.0.81.0 . We have tested OpenAccess ORM with the newer version – 1.0.82.0 and we did not find any issues working with it so far. If you would like to use the newer version of the assembly, you should specify this in the config file of your project. 
    Add the following in the configuration section:

    <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.SQLite" />
          <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite"
    type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.82.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
        </DbProviderFactories>
      </system.data>

    What is left is only to add an assembly reference in your project to the System.Data.SQLLite.dll version 1.0.82.0.

    If you have any other issues, do not hesitate to contact us.

    Kind regards,
    Hristo Marinov
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  3. DevCraft banner
  4. Jose Mejia
    Jose  Mejia avatar
    107 posts
    Member since:
    May 2009

    Posted 10 Dec 2012 Link to this post

    Hi!

    One more question: is it possible to provide visibility accessor for generated model class? Where can I set in t4 templates?

    Thanks.
  5. Answer
    Hristo Marinov
    Admin
    Hristo Marinov avatar
    13 posts

    Posted 13 Dec 2012 Link to this post

    Hi Jose,

    When adding an OpenAccess service, the wizard is looking first for code generation scripts in the Host project with the needed names. If such files do not exist, it will use the default templates provided with the product. They are located in the OpenAccess installation folder.

    For the Dto layer used with WCF Plain Services, navigate to
    <install-dir>/dsl20XX/CodeGenerationTemplates/Dto/<language>/.
    For the Service Layer navigate to 
    <install-dir>/dsl20XX/Extensibility/Dsw/Templates/<language>/   

    The way we recommend to customize the code generation templates is:

    1.  Choose the templates you want to edit
    2.  Copy them into the Host Project 
    3.  Edit the copied templates and save them
    Note that when you paste or save the templates, Visual Studio will automatically generate code files. Please delete them. Here you can find more detailed information about customizing code generation templates.

    When changing the T4 templates bear in mind that you should change the Accessibility Levels of methods, properties and events which are used in a class to implement an interface – they must be public because of the interface specifics, otherwise the generated code will not be buildable.

    Kindly let me know if you need any additional information.

    Regards,
    Hristo Marinov
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
Back to Top