C# DAO to DTO tool class
C# DAO to DTO tool class thought DAO (Data Access Object) data access object is the object we transfer when doing structured database access. Through this object we can establish a mapping relationship with the tables in the database DTO (Data Transfer Object) is the object we pass when exchanging data with the front end Why do we need to set these two objects? For data security If we directly pass the DAO data, we may strip away the entire database. For example, if a user’s data, including the user’s ID, user account, password, etc., is passed directly to the front end, the user’s password may be Once captured by the packet capture software, the user account may be stolen later. In order to prevent this situation, we directly replace the data from the backend In addition to DTO, we will even set up an intermediate model when exchanging certain data with the database on some backends instead of using DAO directly. Because some database tables have too many fields, when we conduct business There may not be so many fields used, so some truncation will be performed Convert ideas Since we need to convert here, properties of both basic…
C# DAO to DTO tool class
C# DAO to DTO tool class thought DAO (Data Access Object) data access object is the object we transfer when doing structured database access. Through this object we can establish a mapping relationship with the tables in the database DTO (Data Transfer Object) is the object we pass when exchanging data with the front end Why do we need to set these two objects? For data security If we directly transfer the DAO data, we may strip away the entire database. For example, if a user’s data, including the user’s ID, user account, password, etc., is passed directly to the front end, the user’s password may be Once captured by the packet capture software, the user account may be stolen later. In order to prevent this situation, we directly replace the data from the backend In addition to DTO, we will even set up an intermediate model when exchanging certain data with the database on some backends instead of using DAO directly. Because some database tables have too many fields, when we conduct business There may not be so many fields used, so some truncation will be performed Convert ideas Since we need to convert here, properties of both basic…