using System.ComponentModel.DataAnnotations.Schema;
public partial class TeamPlus_msg
{
public string Account_List { get; set; }
[NotMapped]
public int MsgType { get; set; }
}
數位種子
2025年12月17日 星期三
[C#] NotMapped 從資料庫對應中排除屬性或類別
表示應該從資料庫對應中排除屬性或類別。
2024年12月11日 星期三
[C#] ExpandoObject 類別的使用方法
public static void Main()
{
dynamic obj = new ExpandoObject();
obj.Name = "Joe";
obj.Sub = (Func<int, int, int>)((int a, int b) => {
return a + b;
});
obj.SetAge = (Action<int>)((int age) => {
obj.Age = age;
});
obj.GetAge = (Func<int>)(() => {
return obj.Age;
});
Console.WriteLine(obj.Name);
Console.WriteLine(obj.Sub(1,2));
obj.SetAge(20);
Console.WriteLine(obj.GetAge());
}
執行結果:
Joe
3
20
2023年7月7日 星期五
2021年12月27日 星期一
2021年6月2日 星期三
2020年11月2日 星期一
[MSSQL] 資料指標 CURSOR 用法
--定義Cursor
DECLARE MyCursor Cursor FOR
SELECT [FieldTypeName] FROM [CRM_Test].[dbo].[FieldType]
--開啟Cursor
Open MyCursor
--定義接收變數
DECLARE @FieldTypeName nvarchar(50)
--迴圈跑Cursor
Fetch NEXT FROM MyCursor INTO @FieldTypeName
While (@@FETCH_STATUS = 0)
BEGIN
print @FieldTypeName
Fetch NEXT FROM MyCursor INTO @FieldTypeName
END
--關閉及釋放cursor
CLOSE MyCursor
DEALLOCATE MyCursor
2020年7月16日 星期四
[jQuery] 判斷元素是否存在
運用陣列的length屬性來判斷:
if ($("#myid").length > 0) {
//do something
}
運用getElementById方法來判斷:
if (document.getElementById("myid")) {
//do something
}
訂閱:
意見 (Atom)