In this paper, the covariance and inversion of c#4.0 new features are described, which will help us to master the c#4.0 program design. The specific analysis is as follows:First, the c#3.0 and the inverse of the previous transformationIf this is the
The client communicates with the server by IP (identifying the host) + port number (identifying the application).IP Address Query method: Windows+r key, input cmd, input ipconfig.Port number: Can be set by itself, but usually 4
Data Table Conversion1 /// 2 // data table conversion class 3 /// 4 /// 5 public class DbTableConvertor where T: new () 6 {7 // 8 // convert DataTable to Object List 9 /// 10 /// to be converted DataTable 11 // 12 public List
Abclearning entry series (5) (display to add, delete, modify, and query)
The general effect is as follows:
1. Add Controller (the X. PagedList used is noted that nuget is added)
Using System. web. mvc; using Abp. application. services. dto; using
MongoRepository, MongDB. Net tool library,
Simple use of MongoRepository
I recently studied the MongoDB database and used an open-source Mongo library in the. net environment. Some simple operations on data are very easy to use, and special
Bad taste of code [3]
Total returned directory
9. Primitive Obsession (basic type paranoid)
This is mainly manifested in the excessive use of basic types.
1. A basic type field that is always put together can be extracted from a class.
2. There is
Bad taste of code [1]. Taste of code
Total returned directory
I. Duplicated Code (repeated Code)
We should follow the DRY principle when writing code: Don't Repeat Yourself. If you see the same program structure in more than one location, you can
C # random partial data,
1. Use the Random pseudo-Random Generator
However, this will cause performance degradation due to the conversion to the array type, so you must avoid this usage.
2. Use Take to return the repeated start to specify the
Bad taste of code [2]
Total returned directory
4. Long Parameter List (too Long Parameter column)
Too long parameter columns are hard to understand. Too many parameters may cause inconsistency and are not easy to use.
1. Generally, if there are
Parallel Programming-pipeline for implementing Parallel operations (producers and consumers ),
This article describes how to use C # To implement a parallel execution pipeline (producer and consumer ):
1. Assembly Line
2. Implementing parallel
C # Use reflection to replicate the values of the same attributes between objects of two classes,
During object conversion, if you need to perform conversion between two classes with the same attribute fields, we want to copy the values of all
[Reconstruction: improving the design of existing code] Reading Notes -- Opening part: Restructuring Reading Notes[Reconstruction: improving the design of existing code] the General Directory of Reading Notes
1. Reconstruction principles
2. Bad
Reconstruction principle,
Before introducing a new technology, we generally need to talk about its history and main principles. Of course, these things are boring and can easily induce sleep worms. However, it cannot be understood. Fortunately, not
C # Json summary,
JSON formatting will occur when writing C #. The following code preliminarily summarizes how to use it.
Newtonsoft. Json. dll must be referenced in either of the following ways:
1. Use JsonSerializer
class JosnUnit {
C # Simple Method for retrieving the Visio Model Information,
A recent project requires the export of Visio drawings. Because it is a construction project, you need to set parameters for wall, door, room, and other information.
Take the wall as an
C # use Oracle. ManagedDataAccess. dll,
When I first came into contact with C #, since the company used Oracle databases, how to connect C # To the Oracle database became the primary knowledge point. There was no ODP at that time..
Why is this
In c #, you can call this method directly to solve the thread access control problem,Problem
When c # is a beginner, a thread delegate is used to execute functions to prevent the software form from being suspended. Use the following code:
Thread th =
Asynchronous and thread blocking, asynchronous thread Blocking
Returned directoryIt should be understood in this way
Asynchronous: early developers had many misunderstandings about it. They thought that the main thread without blocking is
C # Remove the first and last characters or strings of a string,
When importing Excel attribute data to layer elements, Excel and SDE database data have an associated field, which is used to import matching attributes to the database.
In actual
C # Study Notes 02 ---- custom class libraries and decompilation,
2.1 custom class library
The custom class library can encapsulate the core code to ensure that the core code is not leaked when delivered to the customer, but also to prevent
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.