Microservices need to make it right
Last month, I went to Brisbane .Net User Group. One of the talks was about Microservice. The key point is we need to make the Microservice right, rather than pretending to have Microservice. I totally agree with that. Because the main key part of Microservice, in my understanding, is self-contained. The microservice won't need to require any external resources and the tasks will be carried out by a microservice is very small. Thus, that is very hard for architects.
HDMI and DVI cannot convert to the Display Port
I felt I am very silly. I got a work laptop, personal business PC and Mac Mini. Then my monitor got three sockets, two HDMI ports and a Display Port. I used two HDMI ports for my work laptop and personal business PC. So there is only a display port for my Mac Mini, but my Mac Mini got a HDMI port out. I do not want to waste it. At the end, I bought a HDMI to display port cable. I found that is not working, because the cable is only support only one direction, that is from Display Port Out (Computer) to the monitor with HDMI. We cannot do it another way. Then I found a forum post suggested to have a Display Port to DVI converter, then use the HDMI to DVI cable, to connect your computer to the adapter. Then I found it won't work too. The Display port to DVI adapter is one direction only too. That is to connect the display port out in the computer side. Then I finally admited I cannot convert HDMI to display port montior
String.Contains won't work in EF Core 3.0
In the past, when I used EF Core 1.1, I can use String.Contains() in where to preform string like search.
Such as:
_db.Customers.where(x=>x.FirstName.constains("michael"))
But we moved to EF Core 3.0. I found that is a problem, I got the exception regarding the LINQ translation. This sort of helper function in where is no longer support.
I need to re-write the query, like this:
_db.Customers.Where(x=>EF.Functions.Like(x.FirstName, "%michael%")
)
Local DB for a small application in C#
I got some old applications which is using spring.net and nhibernation with sqlite. By these names, you can know those frameworks are very old. That is the time to modernize them. I have research some local database solution. You can use System.data.sqlite, that is very light weight, but that is a plain sql without ORM. Or you can use MSSQLLocalDB with entity framework. But the SQL Express is still required. Finally, I found liteDB. This is a local NoSQL framework. You can add a single DLL into your project, not even simpler, just use Nuget to install it. The code syntax is similar with MongoDB.
Moreover, it has GUI tool LiteDB Studio, you can query the db file. Lastly, I checked the latest git commit is only 4 hours only. The project keeps to be active
Angular CLI time out in .Net Core Project
I created the first project in Visual Studio 2019 in Mac. I have no problems, but when I tried to run it in my Windows box. But I got a runtime error for Angular CLI Timeout. I got exact same code of mac version. There should be no problems. After some investigations, because my windows box is old, that is a five year old laptop. Although mac book pro is 6 year old too, but that is still running better than my windows box. Thus, the angular CLI still can compile the client front end within the default angular cli timeout amount. Therefore, I just need to increase the timeout for Angular CLI. Then I tried it, to increase the timeout of Angular CLI, you need to change startup.cs at the root level of project. please add this line of code after spa.UseAngularCliServer(npmScript: "start"); (should be line 70)
spa.Options.StartupTimeout = TimeSpan.FromSeconds(500);
Then my project is working