Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Things you might consider to improve your code: Use nameof instead of magic strings. Example: OnPropertyChanged("User"); can be replaced with OnPropertyChanged(nameof(User));. This allows for ...
Answer
#1: Initial revision
Things you might consider to improve your code: 1. Use `nameof` instead of magic strings. Example: `OnPropertyChanged("User");` can be replaced with `OnPropertyChanged(nameof(User));`. This allows for renaming to properly work. 2. Consider using on ORM such as [Entity Framework Core](https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core.html) instead of explicitly writing the queries. This is particularly useful for CRUD operations where EF does the tracking of changes to be persisted. 3. Not sure, but the little image suggests that the MySql queries are placed inside the ViewModel. It is a good idea to have a clear separation between the data persistence layer and the view. You can create another project (class library?) to include all data access related functionality. 4. Consider [replacing MD5](https://security.stackexchange.com/questions/19906/is-md5-considered-insecure) with [SHA256](https://stackoverflow.com/a/34712689/2780791) or similar.