icon

CodeTrigger   Forum

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

migrator

all messages by user

03/12/2017
Topic:
No items listed in SchemaObjects tab

migrator
migrator
Administrator
I had downloaded second time and try to figure it out how to create business
object for me. No matter how I try, I just can not have any item under the
"schema object select\De-select all" tab, it suppose to have all the table
on the sql server should appear here, could some one help. I am create a
asp.net and use vs 2017 under windows 10. using stander license
03/12/2017
Topic:
No items listed in SchemaObjects tab

migrator
migrator
Administrator
Hi,

First thing to check is your schema name setting. Please make sure the Schema Name text box in your data source configuration is blank with no
space, then click Refresh.
Does it work now? or Do you have an 'Error/Warnings' link showing on the schema
objects tab, which might indicate if you have some other error?

The Schema Name filter is helpful when you have a database with multiple schemas and lots of tables and you want to limit the tables presented to you (also faster). However if you miss-spell the schema name you can end up filtering out all the tables.
03/12/2017
Topic:
No items listed in SchemaObjects tab

migrator
migrator
Administrator
Thank you for your help, I just leave the Schema Name text box
empty, then it worked fine.
03/12/2017
Topic:
Customization of business object

migrator
migrator
Administrator
Hi, I need add some methods in to my bussiness class. For example GetByTitle(string title) When I create new column in database, I recreate my bussiness object. But my customization disapper, lost. Do you have any suggestion, how I do not lost my custom code, after recreate? Thanks
03/12/2017
Topic:
Customization of business object

migrator
migrator
Administrator
Please see the topic customising code generation and templates
edited by migrator on 12/3/2017
03/12/2017
Topic:
Business objects missing

migrator
migrator
Administrator
I down load trial version Code Trigger standalon, after install it, I create a new code trigger project but after test sql server connection ok, But I did not have Business Object appear on the menu tab, is I missing something?
03/12/2017
Topic:
Business objects missing

migrator
migrator
Administrator
Please see the topic no items in schema objects tab
edited by migrator on 12/3/2017
03/12/2017
Topic:
Security on the WebApi

migrator
migrator
Administrator
Hello, how do you enable security on the WebAPI so the use has to be logged in before accessing the data?
edited by migrator on 12/3/2017
03/12/2017
Topic:
Security on the WebApi

migrator
migrator
Administrator
Security on the Api is managed using Asp.Net Identity. This wizard option "Use Asp.net Identity" has to be selected when the wizard is first used to create the project. It will then generate .net identity tables if required in the db, as well as security code and the required attributes on the Api functions. It cannot be retrofitted if not selected at wizard creation time.
For an example of security on the API, create an MVC app using the wizard and select the identity option. You will then be required to login to the app, and the API is configured to require authentication.
03/12/2017
Topic:
Example of CodeTrigger and Microservices

migrator
migrator
Administrator
Hi, do you have an example on how to use the MicroServices?
03/12/2017
Topic:
Example of CodeTrigger and Microservices

migrator
migrator
Administrator
Hello, for an example of using the Microservices wizard, see:
https://www.codetrigger.com/tutorialpatterns/unitofworkpattern.aspx


You might also find this blog post interesting, it is a light hearted account involving building out a microServices platform using CodeTrigger:
https://rapidcodeframeworks.com/2017/06/24/microservices-the-great-negotiator/
03/12/2017
Topic:
Specified Cast is not valid

migrator
migrator
Administrator
Hi - I'm trying the program. Tutorial WPF app: At this step: Step 4 - Select Business Objects. Click the Business objects tab. There will be a slight delay while CodeTrigger builds up a Business Domain Model based on your selections so far. After which you will be presented with a list of business objects. ... there is no BO generated and an error: "Specified cast is not valid". I tried even selecting only one single table an I still get this. VS2017 with MS SQL 13.0.4001.0 on localhost. How can I fix this ? Thanks !
03/12/2017
Topic:
Specified Cast is not valid

migrator
migrator
Administrator
Hi
If you could send a schema definition file (zipped) of your database tables we will be happy to look into this in detail.
However one thing that might be helpful for you to investigate further:
Even when you select only one table which has simple fields, say 2 integer columns, if that table has a relationship (foreign key etc) to other tables, those related tables will also be parsed. So the problem may lie with a table you didnt explicitly select. To verify this, try it on a simple table with no relationships. Then examine the relationships on the original single table you tried previously, i believe this will point you to the table thats actually causing the error.

You can then 'fix' the problematic table by changing the problem field type to a more commonly used suitable field type.
However we would still be interested in knowing the schema definition of the related table that caused the error.
03/12/2017
Topic:
Specified Cast is not valid

migrator
migrator
Administrator
I created a DB with a single table and had the same issue:


CREATE TABLE [dbo].[iso.Language_tb](
[Code] [varchar](5) NOT NULL,
[Documentation] [nvarchar](100) NOT NULL,
CONSTRAINT [iso.Language.Code_pk] PRIMARY KEY CLUSTERED
(
[Code] ASC
)
)
GO


Thanks for your help
03/12/2017
Topic:
Specified Cast is not valid

migrator
migrator
Administrator
Looks like the problem is the '.' In your table name. Its not coping very well with that naming convention. If you replace the '.' to '_' ie dbo.iso_language_tb then it works
edited by migrator on 12/3/2017
03/12/2017
Topic:
Transferring hierarchical data structure across

migrator
migrator
Administrator
I have an application where I need to allow the user to post a single object to the database so I can allow the user to share that information with a group of users. A simplified generated object structure is like this, and each corresponds to a table that code trigger has created an equivalent data and business object.


Project Table
ID
Name


--- SubProject Table
--- ID
--- Name
--- Comments
--- ProjectID


-------- WorkDetails Table
-------- ID
-------- Name
-------- Details
-------- SubProjectID


What is the best way to get all the information across for a specific project instance and its associated child tables so that I can recreate it on the server side? When I try to serialize it, it only returns the project object, no child collections. Your wcf sample version does the same thing. Is there a better way to do this, because essentially I need to have the client send my the project object and its hierarchy and then create a new version of it on the server. The only other option is manually call each one from project on down, but that could result in quite a few calls. Any suggestion would be appreciated
03/12/2017
Topic:
Log and Audit Trail

migrator
migrator
Administrator
How can I maintain the Audit Trail of data and then how can I make and see the data comparison in it ? However, I Have seen Action Log but Data Comparison in Audit Trail is not available in it.
03/12/2017
Topic:
Log and Audit Trail

migrator
migrator
Administrator
Please see the logging tutorial
If you follow this approach for the logging, you might then be able to customise the

static partial void LogDoing(object o, string memberName){ ... }

static partial void LogDone(object o, string memberName){ .... }

methods, to save to an AuditTrail?
03/12/2017
Topic:
Master Detail Unit-Of-Work Transactions

migrator
migrator
Administrator
How Can I Save and Update the Master Child Entry in Single Transaction using CodeTrigger
Especially if the primary keys are auto generated, and i have to retrieve the master ID/primary key to save in the foreign key field of the child item
03/12/2017
Topic:
Master Detail Unit-Of-Work Transactions

migrator
migrator
Administrator
See unit of work pattern tutorial on the website
for details on transaction construction.

See the section 'Getting db auto-generated numbers/keys from one transaction step to the next'
for details on how you can pass the primary/foreign key of a detail object to the master object in a single transaction