我得到一个错误,当我尝试建立:不含定义或扩展方法
不含定义或扩展方法
我有一类这样的:
[Serializable]
public class JobFile
{
private FileInfo mFileInfo;
private string mJobNumber = string.Empty;
private string mBaseJobNumber = string.Empty;
private Guid mDocumentTytpeid = Guid.Empty;
public string DocumentTypeDescription
{
get
{
string description;
DocumentType DocType;
DocType = DocumentType.GetDocType(DocumentTypeCode);
if (DocType.Code == null)
description = "Unknown";
else
description = DocType.Description;
return description;
}
}
public Guid DocumentTypeID
{
get
{
DocumentType DocType;
DocType = DocumentType.GetDocType(DocumentTypeCode);
if (DocType.Code == null)
mDocumentTytpeid = Guid.Empty;
else
mDocumentTytpeid = DocType.Id;
return mDocumentTytpeid;
}
}
现在我试图让Documenttypeid的价值在我的其他类,像这样:
foreach (FileInfo fi in files)
{
JobFile jf = null;
jf = new JobFile(ref fi);
f.DocumentTypeId = jf.DocumentTypeID; //<-- error is here
}
有谁知道什么可能是错的,以及如何解决它? 谢谢。
in'f.DocumentTypeId','f'的类型是什么? –
循环中声明了“f”的位置?它不应该是'fi'吗? –
请发布完整的错误文本。并且自己格式化你的代码,这是不可读的。 – abatishchev