1
我已經嘗試創建登錄表單,並且還想顯示我已存儲在數據庫中的用戶登錄配置文件。但是,我不知道如何從模型或控制器中做到這一點。顯示數據庫中的用戶配置文件
我已將所有用戶信息存儲在數據庫的Customers表中。
這是用戶模型的代碼:
public IList<Customer> GetProfileCustomer(string name)
{
var list_customer = from c in DataContext.Customers
where c.WebAccount == name
select c;
return list_customer.ToList();
}
而且這是我的AccountController:
public ActionResult ShowProfile()
{
return View();
}
我想,我在我的模型中寫道,在我看來,以顯示結果。
,當我在使用GetProfileCustomer()我控制器,它錯誤,它不包含在當前的上下文中。我準備將我的控制器中的所有模型導入。 – Nothing 2011-12-17 02:31:52