0

我在几分钟(75)内使用LINQ. 现在我想使用LINQ. 谁能帮帮我吗。

谢谢你。我尝试使用以下代码,但没有成功。

TimeSpan tsMinutes;
try
{    
   using (VodafoneDataClassesDataContext vodafoneDataClassesDataContext = new VodafoneDataClassesDataContext())
   {
        vodafoneDataClassesDataContext.Connection.ConnectionString = BECommon.VodafoneConnectionString;
        return (from auditFormsFilledMasters in vodafoneDataClassesDataContext.AuditFormsFilledMasters
        join storeMasters in vodafoneDataClassesDataContext.StoreMasters 
             on auditFormsFilledMasters.StoreId equals storeMasters.Id
        join deskMasters in vodafoneDataClassesDataContext.DeskMasters 
             on auditFormsFilledMasters.DeskId equals deskMasters.Id
        join usersMasters in vodafoneDataClassesDataContext.UserMasters 
             on auditFormsFilledMasters.AuditorId equals usersMasters.Id into tempMaster
        from TempCircleStore in tempMaster.DefaultIfEmpty()
        where auditFormsFilledMasters.StoreId == fieldStoreId
        select new BEAuditFormsFilledMaster
        {
            minutesSpan =  new TimeSpan(0, Convert.ToInt32(auditFormsFilledMasters.LengthofRecordinMin.ToString()), 0),
            tsMinutes = new TimeSpan(0, Convert.ToInt32(auditFormsFilledMasters.LengthofRecordinMin.ToString()), 0),
            LengthofConversation = auditFormsFilledMasters.LengthofRecordinMin.ToString(),
            where auditFormsFilledValues.AuditFormsFilledMasterId == auditFormsFilledMasters.Id
            select auditFormsFilledValues.SelectedScore).Sum(),
        }).ToList<BEAuditFormsFilledMaster>().AsReadOnly();
 }
4

1 回答 1

4

您需要做的是使用TimeSpan.FromMinutes函数和重载ToString函数:

TimeSpan.FromMinutes(theAmountOfMinutes).ToString(@"hh\:mm\:ss:")
于 2013-07-26T08:31:31.460 回答