/// <summary>
/// 添加庄稼
/// </summary>
/// <param name="_UserFarm"></param>
/// <returns></returns>
public UserFarm AddUserFarm(UserFarm _UserFarm)
{
DataContext.AddToUserFarm(_UserFarm);
DataContext.SaveChanges();
return _UserFarm;
}
---------------------------------------------以上不可以是添加 ,为更新的操作.--------------
/// <summary>
/// 添加庄稼
/// </summary>
/// <param name="_UserFarm"></param>
/// <returns></returns>
public UserFarm AddUserFarm(UserFarm _UserFarm)
{
UserFarm uf = new UserFarm();
uf = _UserFarm;
DataContext.AddToUserFarm(uf);
DataContext.SaveChanges();
return uf;
}