示例#1
0
 public object Get(Rockstars request)
 {
     return(new RockstarsResponse {
         Aged = request.Age,
         Total = Db.Scalar <int>("select count(*) from Rockstar"),
         Results = request.Id != default(int)
             ? Db.Select <Rockstar>(q => q.Id == request.Id)
             : request.Age.HasValue
                 ? Db.Select <Rockstar>(q => q.Age == request.Age.Value)
                 : Db.Select <Rockstar>()
     });
 }
 public object Get(Rockstars request)
 {
     return new RockstarsResponse {
         Aged = request.Age,
         Total = Db.Scalar<int>("select count(*) from Rockstar"),
         Results = request.Id != default(int)
             ? Db.Select<Rockstar>(q => q.Id == request.Id)
             : request.Age.HasValue
                 ? Db.Select<Rockstar>(q => q.Age == request.Age.Value)
                 : Db.Select<Rockstar>()
     };
 }