用 Entity Framework 6 (EF6) 自動生成 Data access Layer (DAL)

我一直以來都係用 ER/Studio 設計 SQL database,然後再用自己寫嘅 CodeSmith template 嚟自動生成 Store Procedures 周埋 C# Data Acess Layer (DAL),時移世異,Embarcardeo 轉咗手,ER/Studio 都唔知叫咗咩名?CodeSmith 就沒落咗,唔見有更新,跟唔上潮流!😰

Continue reading “用 Entity Framework 6 (EF6) 自動生成 Data access Layer (DAL)”

Firebase Cloud Messaging + VWG

Firebase Cloud MessagingWeb PushWeb APIService Worker 好多名詞,😂

Firebase Cloud Messaging (FCM) 前身係 Google Cloud Messaging (GCM),Google 買咗 Firebase 之後將 GCM 併入 Firebase 改名為 FCM,FCM 可以推送你嘅 notifications 去 iOS/Android devices 同埋 Web Browser。iOS 同 Android 收 notification 一啲都冇出奇,因為自從有 smart phone 就好似有 notification 哩樣嘢,我要玩嘅係:用 VWG (C#)喺 server 推送 notification 俾 desktop computers’ Web Browsers,好新鮮嘅技術,2015 年底先至有,目前好似淨係 Chrome 同 Firefox 有此功能,Safari 都未跟上。

Continue reading “Firebase Cloud Messaging + VWG”

Visual Studio 2015 + Git

Visual Studio source control 除咗可以用 Microsoft 自己嘅 Team Foundation client 之外,亦可以用 Microsoft Git Provider,以前我一直係 Team Foundation Server 嘅粉絲,自從 TFS 2008 之後我就改用 BitBucket,不過,Microsoft 佢個 Microsoft Git Provider 就好雞嘅,我一直都係用 Git Source Control Provider,Microsoft 就唔死心,時不時出嚟搞破壞,有親 service pack 就會將你安裝咗嘅 3rd party Git Provider 鏟走,迫你用佢隻 Microsoft Git Provider。

Continue reading “Visual Studio 2015 + Git”

Object reference not set to an instance of an object

我用開嘅 Visual Studio 2015 無端端出現哩個 error:

Object reference not set to an instance of an object

之前曾經出現過一啲無厘頭嘅 errors,不過自從用咗 Run as administrator 就好似冇哂,所以就一直冇理佢係咩原因會咁,寫下 program 啫,唔使下下都要做柯南㗎!係咪?😎

Continue reading “Object reference not set to an instance of an object”

RESTier 自選動作 + Swagger

剛剛講完用 RESTier auto 生成 REST API,每隻 table 都有基本嘅 CRUD 功能,跟手就要講講點樣可以搞非 CRUD 我話嘅「自選動作」,同時,為咗增加趣味,我用 SwashBuckle 搞埋 Swagger 式嘅 API documents。要提一提,SwashBuckle 仲未可以直接 gen 埋 RESTier 嘅 API documents,遲啲應該會得,又或者我唔識,因為論壇有網友講過,你可以去 Google 下。

Continue reading “RESTier 自選動作 + Swagger”

RESTier - .NET RESTful API Framework

個 title 全英文,有啲唔慣,不過冇法,都唔知可以點加中文?最多係將 Framework 改做框架,框咩架吖,奇奇怪怪!

一年多前,我打算用 DreamFactory 嚟搞 REST API,當時用緊 v1.9.4,用得好開心,不過 DreamFactory 發展得好快,轉下眼就出 version 2.2,仲改埋個 license,收起啲 database connectors,以後要俾錢先可以 connect database。唔可以 connect database 即係冇用。

Continue reading “RESTier - .NET RESTful API Framework”

Visual WebGUI Custom Control

上次講咗直接用 HtmlBox run Xonomy(一個建基於 jQuery 的 XML editor),今次就係講掂樣將佢整做 Custom Control,整成 Custom Control 嘅好處多多,例如可以將喲 css/ js/images/html  都做成 embedded 檔案,唔使担心裝漏咗,又或者錯咗版本。不過,你需要識嘅嘢就多喲,睇落高檔啲,實際都係 pro 啲嘅,如果學有所成,日後要喺 Visual WebGUI 入面用 jQuery 的 plugins 就易好多!

首先,用 VS2010 開一個新嘅吉嘅 solution,solution 名係 VWG.Community,加第一隻 project,project type 要選做 Visual WebGUI Library,而 project 名就叫 VWG.Community.Forms ,咁,日後有第 2 第 3 隻 Custom Controls 都可以放喺同一個 project 入面。 delete 咗 create new project 時候 VS2010 佢送嘅 UserControl1.cs,再 add 一個 new item Visual WebGUI Custom Control ,個名用 XonomyBox,我哋以後就叫哩個 Custom  Control 做 XonomyBox,個 Assembly name 就係 VWG.Community.Forms.XonomyBox,完成嘅話就會好似下面張圖咁:

Screen Shot 2016-02-23 at 10.06.33 AM

Continue reading “Visual WebGUI Custom Control”