Last week at my Entity Framework training I got a question whether you can use database initializer while still using EDMX file. The answer, as it turned out, isn’t that straightforward.
Directly you can’t. Because you need DbContext to create IDatabaseInitializer<T> (or to derive from default ones respectively). Even if you try to wrap ObjectContext into
DbContext you’ll fail. The default objects are derived from EntityObjects and this is something that’s a showstopper for
DbContext. So that’s a bad news.
On the other hand, there’s a good news, kind of. There’s a template (from Microsoft) to generate
DbContext and classes from EDMX file.
With this template you will get all you need to start using database initializers. Only problem is, that you don’t have configurations generated from EDMX. But there’s also 3rd template, that can generate configurations (I haven’t tested it exhaustively).
Final answer? Yes you can, but it’s not smooth as it could be.
Rok se s rokem sešel a koná se další MS Fest. Tentokrát nabídnu něco alternativního. Podíváme se na databázový stroj Firebird. A protože Firebird nabízí i Embedded verzi, kterážto je velmi zajímavá, porovnáme ji i s konkurencí v podobě MS SQL Server CE.
Microsoft SQL Server není jedinou databází, kterou můžete používat z .NETu. Ačkoli nabízí i verzi zdarma a je plně podporován mnoha nástroji ve Visual Studiu, existují i zajímavé alternativy. Firebird může být jednou z nich. Je zdarma, výkonný, přitom nenáročný a malý. Nabízí Embedded verzi, která je (nejen) alternativou k Microsoft SQL Serveru CE. V rámci přednášky si představíme Firebird jako databázový server a ukážeme so základní práci. Nakonec se zaměříme na Embedded verzi, porovnáme možnosti s MS SQL CE 4 a vytvoříme funkční aplikaci.
Více info na ms-fest.cz.
I’m not writing often about services I use etc. But from time to time I’m extremely pleased with some and that’s worth mentioning. This time it’s Synology. I’m using Synology NAS boxes for a many years and in my opinion these are the best. But that’s not what I like to talk about.
Recently one box started behaving very slowly. Both internal processes, Windows share access and web interface. I did couple of usual checks, and checked health of disks. Nothing. At that time also new firmware came out so I decided it will not hurt to update it, maybe it will solve the problem. The download and installation was very slow, of course and I actually needed more attempts to install it. But no specific error, except second to last try when it was showing me problem with free space on system partition. That brought me to suspicion that the slow behavior is related to it. Couple of quick attempts with this and that, but no luck. Before I go to SSH and look and it from inside, I decided to contact support. Maybe they have so tried-and-true solution. The responses were reasonably fast and I end up sending debug dump of system as asked. Synology investigated the dump and it turned out one of the disks in RAID 1 was dying. Sure when I was doing the initial checks, the S.M.A.R.T. was without errors (who knows why). When I ran it after getting the reply, errors were there. Bad timing.
Synology not only – for free – analyzed the dump, but also provided me with description of what disk is failing, serial number etc. They could tell me something like “Your disk is wrong.” and I would not believe it, because I was focused on the system and system partition. Maybe later I would found the errors myself when again checking everything that could go wrong. But that might be too late (well probably not with RAID 1, but why running on thin ice).
With that being said. Great service Synology!
Few days ago we started using
#efhelp hashtag for Entity Framework related questions. It’s starting well so far, but there was one small problem. Without a support from client application you can’t follow hashtag. That leaves you with the search “solution”.
To make it little bit more pleasant for people interested in
#efhelp, I created a simple bot, that retweets everything with
#efhelp under @EFHelp account. Hence now you can follow this account to be in picture. (Posting to that account does nothing and it’s not actively monitored.)
If you’re looking for a help related to Entity Framework and you’re on Twitter (mine is @cincura_net) you can try asking with hashtag
#efhelp. Sure, no promises about getting reply, but this hashtag is monitored with a lot of skilled people. If it not fits into 140 characters, you might also find somebody willing to help you using different channel (i.e. email, on-site, …).
If you’re using Firebird from .NET you should visit my talk on Firebird Conference 2011. This year it’s in Luxembourg at November 25-26.
There’s no schedule yet (in time of writing), but I can tell you, that my talk will be on Friday, for sure. Topics covered are obvious. Everything worth mentioning from last year or so in .NET provider development and also some future plans. Feel free to come and ask whatever .NET provider related (or Firebird) you want.
P.S. Would you be interested in picking up some Twitter questions during the talk?