WebMisCentral-the Client is compatible with MySql databases. because WebMisCentral uses EF5.0, it is very easy to adapt. The following describes the operation:
1. in the ElegantWM. WebUI layer (or ElegantWM. DAL), download MySQL. Data 6.7.5 through NUGET.
2. modify Web. config as follows:
.....
......
........
Note that the blue part above is newly added, and the rest is not required.
Specifically, you can add multiple database connection strings of different types or the same type in connectionStrings, because in WMC, database connection strings are refined to objects, different objects can have different connection strings, that is, they can operate on different databases.
3. modify DBContext. cs of ElegantWM. DAL to the following:
Namespace ElegantWM. DAL {public class DB: DbContext {// public static readonly log4net. ILog log = log4net. logManager. getLogger (System. reflection. methodBase. getCurrentMethod (). declaringType); // Configure the connection string. default database defadbdbpublic DB (string _ ConnectStr): base (_ ConnectStr){// This is the previous practice // Database. Connection. ConnectionString = ConfigurationManager. ConnectionStrings [_ ConnectStr]. ToString ();Database. SetInitializer
(Null); // this. Configuration. LazyLoadingEnabled = false ;}
4. sorry, the timestamp RowVersion in MySql does not support well in C # EF. you need to change byte [] to DateTime, so you need to change ElegantWM. entity in EntityModel. cs and IEntity. modify the RowVersion type in cs to DateTime.
5. OK. you can use MYSQL.
6. efprof.exe, a MySql tool for monitoring ef SQL, is free for 30 days. it is very convenient and powerful to use.