Posts by Renato • 156 points
4 posts
-
-1
votes3
answers656
viewsA: Generate password hash and save to database
This code generates MD5 HASH passwords when I need to save them to the encrypted database: public string HashMd5(string input) { MD5 md5Hash = MD5.Create(); byte[] data =…
-
4
votes1
answer2076
viewsA: How to set a Primary key to an existing table on Oracle?
The correct command to add to Primary key would be: ALTER TABLE table_name ADD CONSTRAINT constraint_name PRIMARY KEY (column1, column2, ... column_n); Applying to your case would be: ALTER TABLE…
-
0
votes3
answers342
viewsA: Where should I put a calculation method? In the entity itself or in the business class?
There is no right or wrong in this case, the architecture itself defines according to the solution you need to implement. If you extract all the business rules from your entity and create…
-
10
votes3
answers129
viewsQ: How to create mandatory exceptions in C#?
Is there any way to make a method make an exception that must be dealt with when the method is invoked? I used the throw new Exception("mensagem de erro") but the treatment is still optional when…