直接看圖
2017年3月24日 星期五
2017年3月8日 星期三
【Resource】The type or namespace name 'XXX' does not exist in the namespace
已經加入了資源檔且命名空間也正確但 ResourceManager 找不到該資源檔命名空間。
2017年3月2日 星期四
【Winform】Add fixed Where condition to select command for BindingSource
在 BindingSource 增加 XXXType = 1 或 XXXDate < GETDATE() 這種哈死的 Where 條件。
2017年2月24日 星期五
【Entity Framework】Using WHERE IN Clause in Stored Procedure by Entity Framework
這題的問題在 EF ObjectContext 的 YourDbEntities 幫你匯進來的方法參數部分是根據宣告內容哈死的,比方說
Create Proc usp_SelectSomething
@Column1 int,
@Column2 varchar(255)
As
Select * From Table
Where Column1 = @Column1 AND Column2 = @Column2
Go
這樣的話在C# EF 取就會是public ObjectResult但是這樣就沒辦法應對 WHERE col IN(...) 的應用,因為無法動態產生不定數量的參數。sp_SelectSomething(global::System.Int32 column1, global::System.String column2) { ... } _MyDbEntitie.usp_SelectSomething(column1, column2);
2017年2月23日 星期四
【C#】PredicateBuilder usage tip
動態串接 AND, OR 條件應該算是非常常見的需求,在 Linq 段我們常會用 PredicateBuilder 這個擴充來達成,但這個擴充使用上我覺得不是那麼直觀,這篇主要只是要簡單紀錄下
var predicateA = PredicateBuilder.False<YourClass>(); var predicateB = PredicateBuilder.True<YourClass>();的差異
訂閱:
文章 (Atom)