Database.ExecuteSqlCommand

Database.ExecuteSqlCommand is very useful when leveraging Entity Framework 4.1/4.2 Code First model to do the data access or object relational mapping. To make sure your code is bullet proof for SQL injection attacks, you must use the parameterized SQL script when calling this method. Following is an example for this purpose.

context.Database.ExecuteSqlCommand(“delete MasterSmsCampaignCertificateInfo where MasterSmsCampaignGuid = @p0 and CertificateId = @p1“,
    TheCampaignGuid,
    certInfo.CertificateId);

Database.ExecuteSqlCommand

Resuming my blog…

It’s been a while since I quit my dedicated co-located web server and even my personal Live blog was moved to wordpress (meaning dead, because of the GFW Sad smile). It’s also been a while that I have told myself countless times that it is time to record this or that into a web log but since I don’t have one and I have to forget about the writing ideas.

Now, I’m resuming my blog because:

  • Recently, I was trying to look back and consolidate some of the knowledge I gained during a WP7 application development. I found that I can’t even get a clue since most of the knowledge/tricks are scattered into many places in my brain. If I could have them somehow record into a web log, it would be much easier for me to consolidate and write down them into a more formal/organized piece of paper
  • It would be much more helpful if someone else can benefit from them
  • …

My posts will cover various areas around technologies, life, and so on. And probably I will use both Chinese and English to write. I’ll see what I can do for this new blog and hope you’ll like it.

Resuming my blog…

卢沟晓月 & 再去天安门

近距离体会卢沟桥和宛平城,倒是真的能感受到扑面而来的历史气息。不像长安街和天安门那边,完全没有想象的那些过往的感觉。或许是因为卢沟桥那边毕竟离喧闹的市井有些距离?

IMG_0703 IMG_0682

广场上捡垃圾的流民为了几个塑料瓶眼看都要大打出手,与阔气的大屏幕背景上红色的思想宣传大字真是,怎么说才好呢,“相映成趣”?我无言以对。

IMG_0862 IMG_0875

卢沟晓月 & 再去天安门