public async Task <IDataResult <string> > GetReportBodyAsync(ResponseModel model) { IList <ReportBody> query = new List <ReportBody>(); var locationList = model.ContactDetails.Select(q => q.Location).Distinct(); foreach (var location in locationList.Where(q => model.location == null || q == model.location)) { var x = new ReportBody { Location = location, ContactCount = model.ContactDetails.Count(q => q.Location == location), PhoneNumberCount = model.ContactDetails.Where(q => !String.IsNullOrEmpty(q.Phone)).Count(q => q.Location == location), }; query.Add(x); } return(new SuccessDataResult <string>(JsonConvert.SerializeObject(query), Messages.ReportBodyCreated)); }
public void setBody(ReportBody body) { this.body = body; }
public void setBody(ReportBody body) { this.body = body; }