コード例 #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>()
     });
 }
コード例 #2
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>()
     };
 }