modelobject.cs

来自「基于LINQ和.NET 3.5 的数据库源码」· CS 代码 · 共 28 行

CS
28
字号
using System;
using Lephone.Data.Definition;

namespace Lephone.UnitTest.Data.Objects
{
    [DbTable("People")]
    public abstract class PeopleModel : DbObjectModel<PeopleModel>
    {
        [Length(5)]
        public abstract string Name { get; set; }

        public static PeopleModel FindByName(string Name)
        {
            return FindOne(Col["Name"] == Name);
        }

        public static long CountName(string Name)
        {
            return GetCount(Col["Name"] == Name);
        }
    }

    public abstract class GuidKey : DbObjectModel<GuidKey, Guid>
    {
        public abstract string Name { get; set; }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?