2
我是新來的MVP模式。我不清楚在哪裏編寫將文件上傳到服務器的邏輯,然後在上傳後執行一些驗證步驟和數據庫操作。請指教。實現文件上傳的MVP模式
public interface IPresenter
{
void UploadFile(string fileName); //For simplicity, file name is passed;
//it can be declared as a property
}
public interface IDefaultView
{
void Upload();
}
public class DefaultPresenter : IPresenter
{
protected DefaultPresenter() {}
public DefaultPresenter(IDefaultView defaultview)
{
this.defaultView = defaultView;
}
public void UploadFile(string fileName)
{
//Do I need to write saving functionality here or call
//defaultView.Upload(fileName)?
//
//From online articles, I have seen all business functionality written here.
//But I think I will not be able to use System.Web in this layer.
}
}
public partial class UploadExtract: IDefaultView
{
public void Upload(fileName)
{
}
}