icon

CodeTrigger   Forum

Code Generation For C#, WPF, WCF, SQL SERVER/ORACLE/MYSQL and Visual Studio 2013-2017

recent posts recent posts - RSS

04/12/2017
Topic:
Incremental development of codebase

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: Incremental development of codebase
Hi,
Updating a project is transparent, once you are aware how its supposed to work, each time you want to generate code you only select the NEW/UPDATED entities you want to (RE)generate. That's why it reverts all to unchecked at the start of each session. It doesn't try to remember what you have already generated because it doesn't need to. If you select an entity then its code will be (re)generated. If you don't select it then its code will not be (re) generated.

There are some base classes that are regenerated every time. If you make changes to them or don't want them regenerated, add them to the 'escaped files' list, otherwise you can ignore them and let them get regenerated. In general avoid changing the generated code directly, however if you do, add the file to the 'escaped files list to avoid it being overwritten.
It is not possible to customise the code generation template (ie prior to code generation). There are other template based code generators out there that fulfil that requirement.

For information on how you can customise the CodeTrigger generated code (ie after code generation) see the 'Customization' section of the features page.
edited by migrator on 12/4/2017
04/12/2017
Topic:
Incremental development of codebase

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: Incremental development of codebase
Hi, Let us say I generate a multi-tier application from database. Over a period of time if I add additional database objects, does the tool support adding new code to existing project? Do I have to re-generate the entire application again? What about customization that are done, will it get overwritten? Also, is it possible to generate a ASP.NET Web API 2.x code base from the database? Is it possible to customize the code generation template? I look forward to your response
04/12/2017
Topic:
Change db connection string at runtime/dynamically

migrator
migrator
Administrator
Posts: 63
Hi, there are some public properties that were created specifically for this purpose, i.e. changing the connectionstring at runtime.
Usage:
At an appropriate place in the code, you can override the connection string by setting it statically:

DATACONN0_TxConnectionProvider.ConnectionString = "Server=xxx;Port=xx;Initial Catalog=etc etc";
DATACONN0_BaseData.StaticConnectionString = "Server=xxx;Port=xx;Initial Catalog=etc etc";

both overrides would be necessary, one is just for queries (non-transactional) and the other provides transactional support.
04/12/2017
Topic:
Change db connection string at runtime/dynamically

migrator
migrator
Administrator
Posts: 63
What is the best way to set the connection string at run time, so the generated data and business objects point to a database specified by code. I need to use this in application where I can't specify the database in a app.config file, since it won't be accessible at runtime
04/12/2017
Topic:
Integrate it with Entity Framework

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: Integrate it with Entity Framework
Hi,
There is no plan to incorporate Entity Framework.
CodeTrigger is an alternative to Entity Framework, to remove the dependency on such 3rd party libraries in your finished product, by using the 100% just code approach. Hence it wouldnt make any sense to bundle Entity Framework.
04/12/2017
Topic:
Integrate it with Entity Framework

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: Integrate it with Entity Framework
Hi , do you have plans to incorporate Entity Framework into your code generator
04/12/2017
Topic:
Dont want the security tables in MVC menu

migrator
migrator
Administrator
Posts: 63
Thank you, you have been very helpful and I'm really liking this generator.
04/12/2017
Topic:
Dont want the security tables in MVC menu

migrator
migrator
Administrator
Posts: 63
Hi,Thanks for letting me know it resolved the issue.The items on the menu are defined in the menuitems.xml file in the root of the mvc project. If you edit that file and remove the links to the security tables, the menu items will not show up at runtime.In addition, once the security tables have been generated, you can switch your schema name back to 'dbo', if you are not planning any schema changes to the security tables
04/12/2017
Topic:
Dont want the security tables in MVC menu

migrator
migrator
Administrator
Posts: 63
hi, I just generated an MVC test app just to see what came out, something very simple targeting an MSSQL db with only two tables. The generations was successful but when I try to build I get this errors. about 180 error related to Identity roles and such things. I need a hint on how to go about it. Thanks.


>>
Hello

Have you specified a 'schema name' in the CodeTrigger data source tab? If you do, it will only generate code relating to that schema. If this is the case, either enter 'security' as the schema name to build only the missing security pieces, or leave the schema name field blank to have the option of building everything
>>

Thank you. I had 'dbo' as the schema and that's why security did not generate. Now it does fine. However, I do not want the security tables to show on the menu when it generates. How do I make them not visible but still generate the needed code to compile successfully?Thanks
edited by migrator on 12/4/2017
04/12/2017
Topic:
Lookup tables result in no edit code functionality

migrator
migrator
Administrator
Posts: 63
Hi,
This can be resolved by changing the db schema in one or both of the following ways, and re-running the code generation:

(1) Creating a new single column on the table as the primary key, perhaps an auto incrementing identity column
(2) In the case of a lookup table that only has reference columns eg TABLE (FK1, FK2), try making adding an extra non-reference column eg TABLE (FK1, FK2, [DESC])

Then re-run code generation, and the issue will be resolved.


If you are not authorised to change the db schema for some reason, then you will have to manually extend the generated classes, by creating extension partial classes to the DAO and BO classes, with edit methods.
This should not require you to make changes to the actual files generated by CodeTrigger, as your extended partial class code will be in extra files, perhaps in an 'extension' folder. However if you do change the code in the generated files,
make sure you 'escape' those files in the advanced options 'escaped files' list, so that your changes are not overwritten.
04/12/2017
Topic:
Lookup tables result in no edit code functionality

migrator
migrator
Administrator
Posts: 63
Thanks for your quick response. I just checked and yes, one had two pk columns. Do you have a sample code or suggested way to go about generating the code for these multi-key tables? Or do I just have to modify it myself manually? Thanks again.
04/12/2017
Topic:
Lookup tables result in no edit code functionality

migrator
migrator
Administrator
Posts: 63
Hi, Edit Links/code is/are generated when a table has a simple primary key, and NOT ALL the columns in the table are in the primary key. For example, lookup tables which contain two columns, but both of the columns are part of the primary key, will not be treated as editable, by the generated UI code
04/12/2017
Topic:
Lookup tables result in no edit code functionality

migrator
migrator
Administrator
Posts: 63
Hi I just generated code for two simple tables and one came out with edit,delete links per row but the other one did not. What determines when these update links show. Both tables have PK columns defined. Thanks, José
04/12/2017
Topic:
App key doesnt exist in appSettings

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: App key doesnt exist in appSettings
Hi,When you hit the red button to generate code, depending on what options you have chosen, you might get a 'Things to Do' tab next to your 'Results' tab. This will normally tell you whether you need to copy a config setting, although in other cases it does it for you automatically.

In any case, search for a file called something like 'generated.config' . This will contain the appSettings that you need to copy into your WPF app.config file, or since you are using WCF, it needs to be copied into the web.config of the WCF service
04/12/2017
Topic:
App key doesnt exist in appSettings

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: App key doesnt exist in appSettings
Hi, First of all, congrat's for your Product: really friendly. Need your help with using the CriteriaAPI, thru a WPF app with WCF Service. I'm actually trying to use the CriteriaAPI to execute a custom query to a Business object. The request is pretty simple, I need to get the ID of a data with a particular text value. I always have an exception throwed, saying my AppKey (connection string) doesn't exist in appSettings. Need your help on that. Regards
04/12/2017
Topic:
PostgreSQL Support

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: PostgreSQL Support
Hi, Thanks for the suggestion! We'll put it on the suggestion board for future consideration.
04/12/2017
Topic:
PostgreSQL Support

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: PostgreSQL Support
Hi, Why not? Its more options to choose from for your customers, and hence greater value. I recommend you should do it.
04/12/2017
Topic:
PostgreSQL Support

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: PostgreSQL Support
Hi, There is currently no plan to add explicit support for postgreSql to CodeTrigger.
04/12/2017
Topic:
PostgreSQL Support

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: PostgreSQL Support
Thank you. How soon will you have support for PostgreSQL?
04/12/2017
Topic:
PostgreSQL Support

migrator
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
Topic: PostgreSQL Support
Hi, CodeTrigger does not support PostgreSQL at this time