public class Task : IBusinessEntity
{
public Task () {}
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public string Name { get; set; }
public string Notes { get; set; }
public bool Done { get; set; }
}
[PrimaryKey, AutoIncrement]
是C#中的索引器吗?
这段代码是用来使用SQLlite的。
索引是在IBusinessEntity
或继承的任何东西中定义的吗?
发布于 2013-09-19 17:56:45
它们被称为属性。
这里是微软的文档,这里是关于它们的教程。
您可以在这样的类级别上声明它们( MSDN教程中的代码):
[AttributeUsage(AttributeTargets.All)]
public class HelpAttribute : System.Attribute
或者在方法层面:
[WebMethod]
public void SomeWebMethod([System.Web.Services.WebMethod(
Description="Describe what your method does here.")])
或者,就像你已经在上面声明过的那样,在会员级别。编码愉快!
发布于 2013-09-19 17:55:15
这些都是属性。它们用于向应用程序的其他部分提供有关成员的元数据。使用属性键装饰成员,方法是将它们放在成员上方的括号中。
https://stackoverflow.com/questions/18901684
复制相似问题