好的,所以我正在将一个webApi从aspnet转换到aspnetcore。
我在HTTP post中包含了以下内容。
var name = ControllerContext.RequestContext.Principal.Identity.Name;
widget.CreatedBy = name;
//Other properties
DataContext.Widgets.Add(entity);我遇到的问题是aspnetcore中似乎不存在RequestContext。我一直在寻找一天中更好的时间来寻找等价物。
发布于 2019-11-11 21:03:49
https://stackoverflow.com/questions/58801660
复制相似问题