The biggest issue I had was connecting to SQLServer Express 2005. Here's the connection string I ended up using:
Server=127.0.0.1,1433;Database=patstracks;Integrated Security=SSPI
ActiveRecord really makes it easy to decorate POCOs using attributes:
[ActiveRecord("[Client]")]
public class Client : ActiveRecordBase{
...
[PrimaryKey]
public int Id
{
get { return id; }
set { id = value; }
}
...
public static Client[] FindByNameLike(string name)
{
return (Client[])Client.FindAll(typeof(Client), new Order[] {Order.Asc("Name") }, new ICriterion[] { Expression.Like("Name", name+"%")});
}
...
}
No comments:
Post a Comment