frankcollins3 / ASPokedex

Pokedex with ASP backend / razor pages, and VanillaJS front end
1 stars 0 forks source link

handling modularized API-URL string bank in ASP.net [7:30am] #19

Open frankcollins3 opened 1 year ago

frankcollins3 commented 1 year ago

attempting to do: make a reference of this below seen url string for http requests elsewhere, and import in this code. Screen Shot 2023-09-22 at 7 30 57 AM

in react/nextJS: one could put these in a utility/url.ts folder or even encapsulate the application with an app.tsx level that delivers typesafe, valuedefined useContext()

error: no error yet

proposed approach: /Data/string.cs (use a namespace)?

possible improvements:

frankcollins3 commented 1 year ago

this is what chatGPT had to say about it: Screen Shot 2023-09-22 at 7 45 35 AM Screen Shot 2023-09-22 at 7 45 24 AM

here's why I find their response confusing. take this invocation of the public class: var apiUrls = new ApiUrls();

// we don't do such a thing for the Model and Controller: Screen Shot 2023-09-22 at 7 46 39 AM Screen Shot 2023-09-22 at 7 46 10 AM [7:49am]

frankcollins3 commented 1 year ago

{insert-tabloidy:"You wont belive what they said!" type of headline} Screen Shot 2023-09-22 at 7 50 37 AM [7:51am]

// sidenote.. before chat responded that was my next question. are classes variables? I guessed that they were objects & it's the reason why I avoided usage of "variable" in the above comment. [7:52am]

frankcollins3 commented 1 year ago

// sidenote: chat redeeming themselves after taking 3 days to set up EF when stack overflow helped in 30 mins lol. [7:53am]

frankcollins3 commented 1 year ago

namespace and public class it is. now having a separate issue with namespace definition and referenceability [8:07am]

frankcollins3 commented 1 year ago

Screen Shot 2023-09-22 at 8 08 46 AM

Screen Shot 2023-09-22 at 8 08 09 AM

Screen Shot 2023-09-22 at 8 08 14 AM [8:09am]

frankcollins3 commented 1 year ago

but then try this and get this output: Screen Shot 2023-09-22 at 8 09 54 AM

Screen Shot 2023-09-22 at 8 09 57 AM [8:10am]