[C#]The returned value of DataContext.ExecuteCommand when executing stored procedures.

In our project, SQL scripts(CRUD in specific) are executed using the class “DataContext” in combination with LinqToSQL,
and then of course, when the method “ExecuteCommand” is invoked, the returned value indicates the rows updated.

When the SQL command executed is simply just an INSERT/UPDATE/DELETE, the result is as obvious as ever.
But when it comes to stored procedures, things might not be that simple. 繼續閱讀 “[C#]The returned value of DataContext.ExecuteCommand when executing stored procedures.”

【Asp.Net MVC】使用 ContextBoundObject 搭配 Attribute 實現 BLL 層及 DAL 層的 AOP Logging 機制

我曾經有發表過一篇「透過 Asp.Net MVC Filter 實作 Controller 層級的 Action Logging 機制」文章,
想必大家也跟我一樣好奇,
如果想更進一步得在 Controller 以外的 BLL 層(Service, 商業邏輯層)或 DAL 層(Repository, 資料訪問層),
掛載能 Logging 傳入 Action 參數值的攔截器到底該如何實作?

繼續閱讀 “【Asp.Net MVC】使用 ContextBoundObject 搭配 Attribute 實現 BLL 層及 DAL 層的 AOP Logging 機制”

透過 Asp.Net MVC Filter 實作 Controller 層級的 Action Logging 機制

.Net MVC Filter 有四種類型:Authorization(驗證)、Action(動作)、Result(結果)、Exception(例外),
有關各類型的介紹可參考 MSDN 的 Filtering in ASP.NET MVC 介紹,
以下本文將簡單介紹如何使用 Asp.Net MVC 中的 Action filters 來實作 Controller 層級 Action Logging 機制 ..

繼續閱讀 “透過 Asp.Net MVC Filter 實作 Controller 層級的 Action Logging 機制”