我首先在asp.net mvc项目中使用实体框架approch代码, 当我想在其控制器中的chargeClienteleDetails列表时,它返回数据,但如果我在另一个控制器中使用相同的代码,则返回null,!
这是chargeClienteleDetails的辩护:
df.sort_index(inplace=True)
idx = pd.IndexSlice
evens = np.arange(2,max(df.index.levels[1])+1,2)
df.loc[idx[['A','B'],evens,True],['III','V']]
Out[]:
III V
Alpha Int Bool
A 2 True -1.041243 -0.561155
B 2 True 0.381918 -0.148990
df.loc[idx[:,evens,:],:]
Out[]:
I II III IV V VI \
Alpha Int Bool
A 2 False 0.791142 0.333383 0.089767 -0.584465 0.295676 -1.323792
True -1.023160 -0.442004 -1.041243 1.613184 -0.561155 0.397923
B 2 False 0.383229 -0.052715 -0.214347 -2.041429 -1.101059 -0.374035
True -0.183386 -0.855367 0.381918 -0.261106 -0.148990 0.621537
VII
Alpha Int Bool
A 2 False 0.717301
True -0.133701
B 2 False 0.166314
True 0.517513
ChargeClienteleDetailsController的行动:
public class ChargeClienteleDetails
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[StringLength(100)]
public string EmailCC { get; set; }
[StringLength(10)]
public string NumClient { get; set; }
}
ChargeClienteleController(另一个控制器):
private ApplicationDbContext db = new ApplicationDbContext()
// GET: ChargeClienteleDetails
public ActionResult Index()
{
return View(db.CCDetails.ToList());// return Data
}