Timtier
Timtier
CC#
Created by cyn on 1/18/2023 in #help
❔ changing values in .csv file with file i/o commands
Np, good luck 😄
13 replies
CC#
Created by cyn on 1/18/2023 in #help
❔ changing values in .csv file with file i/o commands
Id think its better as you can ensure the file is only replaced once your edited file is done, though it depends on your situation
13 replies
CC#
Created by cyn on 1/18/2023 in #help
❔ changing values in .csv file with file i/o commands
Directly, maybe, not sure since im not behind a PC to google :p But basically: 1. Create new file. 2. Delete (or rename) old file 3. Rename new file to old name. 4. Delete old file if you havent yet.
13 replies
CC#
Created by cyn on 1/18/2023 in #help
❔ changing values in .csv file with file i/o commands
Though keep in mind that might become a bit messy considering you'll need to keep the same order of all entries to not mess with data integrity. Creating an entirely new file and removing/archiving the old one might be easier and safer unless needed
13 replies
CC#
Created by cyn on 1/18/2023 in #help
❔ changing values in .csv file with file i/o commands
You'd need to open a FileStream on this file to change the contents. Something like a StreamWriter ( or one of its implementations) would then allow you to write in it
13 replies
CC#
Created by dankmememachine on 1/12/2023 in #help
❔ How to format float to currency
Fair, intresting 👀
29 replies
CC#
Created by dankmememachine on 1/12/2023 in #help
❔ How to format float to currency
Not decimal due to potential numeric sizes and rounding? 🤔
29 replies
CC#
Created by KidKai25 on 1/11/2023 in #help
❔ Commandments for C# developers?
- Always test your code by running it locally grinowo
101 replies
CC#
Created by KidKai25 on 1/11/2023 in #help
❔ Commandments for C# developers?
Just messing around but I agree with the point FaunaNod
101 replies
CC#
Created by KidKai25 on 1/11/2023 in #help
❔ Commandments for C# developers?
- Don't use Convert.To*
System.Convert.ToBase64String though catHeyHello
101 replies
CC#
Created by Scythe on 1/4/2023 in #help
JSON child objects within a RestRequest body
I think just making something along the lines of this might be easiest: { "source": "non-archived", "fields": ["type", "title", "tags", "cuepoints", "data"], "filter": { "artist": "Dr. Peacock", "title": "Medication" } }
5 replies
CC#
Created by Scythe on 1/4/2023 in #help
JSON child objects within a RestRequest body
If you want to make it generic and let whatever consumes the filter do mapping, a dictionary of string keys and string values would also work
5 replies
CC#
Created by Scythe on 1/4/2023 in #help
JSON child objects within a RestRequest body
It looks like your filter object should just be a simple class or record containing (optional) strings; artist and title
5 replies
CC#
Created by KidKai25 on 12/23/2022 in #help
❔ ✅ What is the bestright thing to do when an Exception occurs say, in my MVC application?
Then in that catch clause of the controller you can return to the user that something failed.
11 replies
CC#
Created by KidKai25 on 12/23/2022 in #help
❔ ✅ What is the bestright thing to do when an Exception occurs say, in my MVC application?
Which should be caught by either the handler that it was called for or the controller (other options are available too but I will exclude them for simplicity)
11 replies
CC#
Created by KidKai25 on 12/23/2022 in #help
❔ ✅ What is the bestright thing to do when an Exception occurs say, in my MVC application?
If a user calls the controller to save something, but that fails in the database class, it will throw an exception
11 replies
CC#
Created by KidKai25 on 12/23/2022 in #help
❔ ✅ What is the bestright thing to do when an Exception occurs say, in my MVC application?
So lets say you have an api which has multiple layers; The controller which calls a Handler class, which itself calls a class that handles database stuff
11 replies
CC#
Created by KidKai25 on 12/23/2022 in #help
❔ ✅ What is the bestright thing to do when an Exception occurs say, in my MVC application?
At the place where the exception actually occurs
11 replies
CC#
Created by KidKai25 on 12/23/2022 in #help
❔ ✅ What is the bestright thing to do when an Exception occurs say, in my MVC application?
You could start with a generic message like: "Failed to [do something], please try again"
11 replies
CC#
Created by KidKai25 on 12/23/2022 in #help
❔ ✅ What is the bestright thing to do when an Exception occurs say, in my MVC application?
Catch the exception and do something to inform the user (if appropiate)
11 replies