それは空になり、データはありませんが、まだ匿名型と言っているようです。正常にコンパイルされ、データはまったく実行されません。これまでのご協力に感謝します
public IQueryable<RentPaidReportRecord> rptRentPaid(string daysFrom, string daysTo, int IN_SiteId, int IN_LandownerId, int IN_PaymentCategoryId, int IN_PaymentTypeId, string IN_ShowRelevantProportion, string IN_OutputFormat,string @IN_URL)
{
DateTime IN_daysFrom = Convert.ToDateTime(daysFrom);
DateTime IN_daysTo = Convert.ToDateTime(daysTo);
var result = this._lmsDb.rptRentPaid(IN_daysFrom, IN_daysTo, IN_SiteId, IN_LandownerId, IN_PaymentCategoryId, IN_PaymentTypeId, IN_ShowRelevantProportion, IN_OutputFormat,IN_URL);
// Need to add in ENUM PaymentCategory to the Output then add col to report, 19/8/2013
// So i've decared paymentCategoryValues below, now need to join it to the SearchResults below
// i.e. SearchResults.PaymentCategoryId = paymentCategoryValues.PaymentCategoryId
//... and be able to Reference the description as Category in the SearchResults object
// Being carefull not to change the IQueryable since its working at the moment just need enum desc col
var paymentCategoryValues =
Enum.GetValues(typeof(PaymentCategory)).Cast<PaymentCategory>().Select
(r => new KeyValuePair<int, string>((int)r, r.ToDescription()));
var searchResults = (from s in result
from c in paymentCategoryValues
where (IN_SiteId <= 0 || s.SiteId == IN_SiteId)
&& (IN_LandownerId <= 0 || s.LandownerId == IN_LandownerId)
&& (IN_PaymentCategoryId <= 0 || s.PaymentCategoryId == IN_PaymentCategoryId)
&& (IN_PaymentTypeId <= 0 || s.PaymentTypeId == IN_PaymentTypeId)
&& (s.PaymentCategoryId == c.Key)
select new RentPaidReportRecord
{
SiteId = s.SiteId,
LandownerId = s.LandownerId,
PaymentCategoryId = s.PaymentCategoryId,
PaymentTypeId = s.PaymentTypeId,
Category = c.Value.ToString()
});
return searchResults.AsQueryable();
}
public class RentPaidReportRecord
{
public int SiteId { get; set; }
public int LandownerId { get; set; }
public int PaymentCategoryId { get; set; }
public int PaymentTypeId { get; set; }
public string Landowner { get; set; }
public string SiteDescription { get; set; }
public string RentalElection { get; set; }
public string Period { get; set; }
public System.Decimal Total { get; set; }
public string Category { get; set; }
public System.Decimal RelevantProportion { get; set; }
public string ShowRelevantProportion { get; set; }
public string URL { get; set; }
}