• Three timers


    There are three kinds of commonTimer : System.Windows.Forms.Timer System.Timers.Timer System.Threading.Timer Zero, system.windows.forms.timer thisTimerIt is single threaded, that is, as long as it runs, other threads will wait. This timer has the following characteristics: Based on the UI thread, when the timer is triggered, the operating system inserts the timer message into the thread message queue, […]

  • Entity Framework one to many relationship mapping


    Relationship mapping is also a key content in EF. Like attribute mapping, relationship mapping is also based onOnModelCreatingConfigure mapping in. There are three kinds of relationship mapping in EF: One to many relationship Many to many relationship One to one relationship Let’s talk about it todayOne to many relationship Zero. Create the required class Abstract […]

  • A concise tutorial on inversion of control and dependency injection


    IOC is an important design idea in OO. This article will lead you to quickly master inversion of control and dependency injection. Note: Code Based on C# Zero, Ioc IOC is inversion of control in English and inversion of control in Chinese. The so-called inversion of control is that there is a call to class […]

  • Entity Framework one-to-one relationship mapping


    One to one relationship is a very complex relationship in the Entity Framework, involvingHasOptional 、WithRequired 、 WithOptionalPrincipal 、 WithOptionalDependent。 In this article, we will explain the usage of these. We take members and orders as an example. A member may or may not have orders, but an order absolutely belongs to a member. We first […]

  • Entity Framework many to many mapping


    In the previous article, we explained the one to many relationship mapping in EF. In this article, we explained the many to many relationship mapping in EF. In this article, we also use a simple example to explain many to many relationship mapping. Zero, automatically generate relation table Story: in a student course selection system, […]

  • Entity Framework entity status


    Starting from today, we will start to explain entity state and data operation in EF. This article first introduces entity state.Through the previous learning, we know that EF is responsible for tracking the status of entities through the upper and lower positions, and the location of entity status is in the namespaceSystem.Dat.EntityLiEntityStateThere are 5 specific […]

  • Entity Framework (5)


    stayMany to many relationship mappingThe association table in is generated automatically by EF. But sometimes we need to show the definition association table. We can define it as follows (continue to use many to many relationship mapping this article code): Define the association table class: public class StudentCourses : BaseEntity { public int StudentId { […]

  • Easy to understand difference between ref and out


    refandoutIt’s the two keywords that are often used in C ා development, but many people don’t know the specific difference between the two keywords. Let’s talk about the two key differences. Similarities and differences between zero, ref and out Same: All by address; The values of the original parameters will be changed after use; Compile […]

  • How to make web crawler with Python


    In recent years, python has set off a lot of waves in the field of programming, and the third Library of Python has also attracted many programmers. Today, we will discuss how to use Python to do a “Web Crawler” to capture some page information. The library we use today (including Python’s own library and […]

  • The change and invariance of const modified variables in C / C + +


    constKeyword is a common keyword in C / C + +, which is used in many booksconstThe decorated variable is described as a constant. In general, a constant cannot be modified. First look at the following code: const int a = 10; a = 11; At this time, some intelligentIDEIn the environment, for examplevs2019The red […]

  • Vector of C + + STL


    1.new vector<int> V; 2.push a element to V V.push_back(element); 3.visit elements in V by index cout << V[i]; by iterator iterator is analogous to pointer,the definer is: vector<typename>::iterator it; then ‘it’ is a variable,the type is ‘vector<typename>::iterator’,we can get the address of the element via *it eg: vector<int>::iterator it = V.begin(); for(int i=0; i<V.size(); i++){ […]

  • . net tool resharper: how can I help visual studio users?


    ReSharperIs a well-known code generation tool that can helpMicrosoft Visual StudioBecome a better ide. In essence, the resharper feature can be used for C, vb.net, XML, asp.net, XAML, and build scripts. With resharper, you can conduct in-depth code analysis, intelligent code assistance, real-time error code highlighting, solution wide code analysis, fast code correction, one-step code […]