SQL Scripts in asp.net core web api application - asp.net-web-api

I have a list of countries , states and cities in TSQL script format and I need to use them for my asp.net 6 web api application . I am using code-first approach ,EF6 for my ORM and SQLServer2019 as my database container.
what I like to have , is that when ,start the application , the app look at my tables , and create country , city and states based on available SQL script in case of they are not existed . can someone guide me on how would be the best practice to do that ?
thanks.

Related

How to find these data from my Revit Model ? (FORGE_MODEL_URN) , (FORGE_MODEL_VIEW), (DEVICE_MODEL_ID )

for starting most projects with Autodesk Forge, I need these data to use in coding. How can I get this information from my model?
(FORGE_MODEL_URN) ?
(FORGE_MODEL_VIEW) ?
(DEVICE_MODEL_ID) ?
FORGE_MODEL_URN and FORGE_MODEL_VIEW (picture)
DEVICE_MODEL_ID (picture)
When building an Autodesk Platform Services (formerly Autodesk Forge) app, usually you just need to pass two env. variables to the app: the client ID (e.g., FORGE_CLIENT_ID) and client secret (e.g., FORGE_CLIENT_SECRET). The environment variables you mentioned are not typical at all. They are likely specific to just one specific sample app.

Creating ADS AEP using VFP

My understanding is that AEP can be developed in any language but I couldn't find any sample for VFP, only VB, C++, etc
As an initial project I wanted to try something simple like send a Product Code and get back the current Stock value from a free ADS table (in fact a VFP table accessed via ADS) + errors handling.
I have good VFP experience (exe applications using ODBC) but nothing in this area (web access).
I made some researches on internet but even for the Startup/Shutdown (part of the template) I found different number of parameters to be passed, so I am confused.
A sample of Startup/Shutdown + a simple function which access a table and get some data (i.e SELECT Field1 FROM MyTable WHERE Field2=<My_Input_Value>), written in VFP for ADS V10.10 would be highly appreciated.
Thanks.

Microsft Dynamics SL SoHeader And SalesPerson relationship- Not able to link

I am trying to create SalesOrder via api and inserting them into SQL database . Tables I am using :
SOHeader and SOLine
Column to insert into both object : SlsperID
I am able to link line wih SLsperId but not with Soheader. I tried to create it manually and then cloned that row in SQL but still its not linking with Sales order. Maybe there is another table which holds relationship between Salesperson and SOheader
I know this is a year old... but just in case this is still an issue.... Could you provide some more details about how you are trying to interface with the Dynamics SL database? You mention that you are "create SalesOrder via api "... What "API are you using? There is no API included in the Dynamics SL product, so to answer your question, it would be very helpful to have a better understanding of what interface you are using.

doing online surveys with spring mvc and limesurvey

hi i'm working in a spring mvc project and i need to add a survey option, the requeriment is sending a link inside a email to a survey or i dont know if you can send the questions inside the email, i will probably lean for the firts option, i'm thinking of using limesurvey or any other open source survey tool who can be integrated with my spring mvc web application.
since i have not worked with a survey tool before, how acctually limesurvey works i asume that this is how it works:
1) you install limesurvey in your server
2) you create the survey with limesurvey UI after it was succesfully installed in your server
3) that survey that i just create give me somekind of URL
if this assumptions are correct,
QUESTIONS:
1) how can i get that url in my spring mvc application so i could send it in a email, since they are to different applications, does lime survey save that url in data base where i could connect with my spring mvc application and get it?
2) the same thing goes with the results can i get access with my spring mvc application to the results since i need that info to create reports,
3) can i create limesurvey surveys from my spring mvc application, if limesurveys create the surveys in a data base can i crete them from and UI in spring and save them in the limesurvey database
4) is there a way to configure the valid period time of a survey, since i dont want that a user can access the survey for long periods of times like 1 hour doing the survey, or being able to access the survey from the link for a entire week, since this can be a problem to my server capacity
Url : if unique link for each user is needed : https://manual.limesurvey.org/RemoteControl_2_API#get_participant_properties . Else a survey link it's allways the same example.org/surveyid.html for example.
https://manual.limesurvey.org/RemoteControl_2_API#export_statistics
https://manual.limesurvey.org/RemoteControl_2_API#add_survey and/or https://manual.limesurvey.org/RemoteControl_2_API#import_survey etc ...
Start and expiry date-time : https://manual.limesurvey.org/Survey_settings#Publication_.26_access_control
Then : I think LS are able to be integrated in your MVC. ANd remind : you can too use Extra plugin use LS core system with newDirectRequest event : https://manual.limesurvey.org/NewDirectRequest Return some json for your MVC if it's easiest for you.
Denis

ASP.Net MVC 3 with EF 4.1: Is it possible to switch from database first to code first

Net MVC 3 web application. I generated my models from an existing database using "database first". But now, I would prefer to use the "code first" paradigm. Is that possible at all? How do I tell my solution that I want it to create tables for new models I code?
Yes but be aware this happens if your database doesn't exist.
see http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx
Add your context class that inherits from DbContext
Declare your DbSet Customers {get;set;}
Add your connect string to your sdf file.
Note the important part regarding your database creation:
"This happens by default if your connection-string points to either a SQL CE or SQL Express database file that does not already exist on disk. You do not need to take any manual steps for this to happen."
So to add to an existing database this way - isn't going to happen.

Resources