bug or not?

Oct 8, 2009 at 4:19 PM

public class vt_CategoryType : IDbObject
    {
        [DbKey]
        public long Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Length(1, 50)]
        [ShowString("类型名称")]
        public string Title { get; set; }

        public vt_CategoryType Init(string title)
        {
            this.Title = title;
            return this;
        }
   
    }

 

public class vt_CategoryType : DbObjectModel<vt_CategoryType>
    {
        /// <summary>
        /// 名称
        /// </summary>
        [Length(1, 50)]
        [ShowString("类型名称")]
        public string Title { get; set; }

        public vt_CategoryType Init(string title)
        {
            this.Title = title;
            return this;
        }
   
    }

 

这俩定义方法在Update的时候,(即Id>0)

只有第一种用: IDbObject定义的类才能执行成功

下面那个用DbObjectModel的会报错

Lephone.Data.DbEntry.Save(t);

Lephone.Data.DbEntry.Update(t);

都会报错

是不是没加 abstract?我看你源代码也没加

Coordinator
Oct 9, 2009 at 4:13 AM

需要加 abstract