public HttpResponseMessage Search([FromUri] TestimonialSearchRequest model) { ItemsResponse <Testimonial> response = new ItemsResponse <Testimonial>(); response.Items = _testimonial.Search(model); return(Request.CreateResponse(HttpStatusCode.OK, response)); }
public List <Testimonial> Search(TestimonialSearchRequest model) { List <Testimonial> list = null; DataProvider.ExecuteCmd(GetConnection, "dbo.Testimonial_Search" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@Inactive", model.Inactive); } , map : delegate(IDataReader reader, short set) { { Testimonial p = new Testimonial(); PersonBase pb = new PersonBase(); p.Person = pb; int ord = 0; //startingOrdinal p.Id = reader.GetSafeInt32(ord++); p.Content = reader.GetSafeString(ord++); p.DateCreated = reader.GetSafeDateTime(ord++); p.DateModified = reader.GetSafeDateTime(ord++); pb.Id = reader.GetSafeInt32(ord++); pb.FirstName = reader.GetSafeString(ord++); pb.MiddleName = reader.GetSafeString(ord++); pb.LastName = reader.GetSafeString(ord++); pb.PhoneNumber = reader.GetSafeString(ord++); pb.Email = reader.GetSafeString(ord++); pb.JobTitle = reader.GetSafeString(ord++); string photo = reader.GetSafeString(ord++); pb.ProfilePicture = "https://sabio-training.s3-us-west-2.amazonaws.com/C31/" + photo; p.Inactive = reader.GetSafeBool(ord++); if (list == null) { list = new List <Testimonial>(); } list.Add(p); } } ); return(list); }