Initial use of gentle. net

Source: Internet
Author: User

Define a table in the database as a special entity class, and use the static method in the broker to perform corresponding operations, including inserting, deleting, and returning result sets.

Query can generate filtering conditions using the key class instead of using SQL statements, as well as SQL statements that can generate fuzzy queries. This provides multiple interfaces for query, which is convenient and practical.

It is found that the codesmith template provided by it has a small error, and there is a problem in the constructor in the class it generates. When assigning values to each attribute, the attribute field contains variableprechar. Compilation is not feasible.

There are still some questions:

1. When the primary key is defined, especially when the Automatically increasing field is the primary key, why does the constructor still have that field? No matter whether I set any value for the primary key field, it is basically not used. The value of the primary key field is the number automatically increased in the database. The value of the Self-Set primary key field is invalid.

2. I don't know whether it is not found or not. I don't know how to use it to write a dataset into the database. If it is cyclically traversed, I am afraid of slowness, I think the final operation of writing a dataset to a database should also be circular and convenient, and then write a record to the database one by one. I don't know if this framework provides a better way to write data sets.

3. Since gentle. Config Only releases one provider, can only one database be designed in one application? If you want to use gentle. Net to operate the tables in two databases for data exchange, simply put, you want to write data from one database to the tables in another database. Can you do this? How do I configure it?

4. Are there any optimizations for operations on large volumes of data? For example, if I return ilist, if I have tens of thousands of records and then perform operations on those records, will it be too memory-consuming and affect the efficiency due to too many records?

5. Why are the classes generated by the two templates mygeneration and codesmith? There is little difference in the subject structure. That is, there are more methods to generate the mygeneration class. Why didn't I add a bit in codesmith? Two generations are foundCodeIn comparison, I think codesmith is better. The structure of mygeneration has not been clarified yet. You have time to check it out.

For the classes generated by codesmith, it is best to add some static methods in it for convenience, including getting objects, getting result sets and deleting objects. It is more efficient to make proper changes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.