目前,我正在开发一个框架,我想在visual studio菜单中添加自定义脚手架选项.

默认情况下,"对话框中带有视图的MVC5控制器,使用实体框架"选项3选择"CodeTemplates\MvcControllerWithContext\Controller.cs.t4",t4再次定位内部视图t4模板

我已经修改了t4模板差不多一年了,我还没有发现一条证据表明它是如何针对这些视图或者如何在脚手架对话框中添加选项.我搜索了很多,但是没有找到任何接近的东西.
总之,我只是在寻找可以添加或修改这些t4模板位置的地方,并在脚手架对话框中添加新脚手架的引用.
任何答案都将非常感激.谢谢.
asp.net-mvc t4 asp.net-mvc-3 asp.net-mvc-scaffolding t4scaffolding
我看过很多关于facebook身份验证的帖子,要么是旧的,要么是不正常的.
然而,最后我在我的项目中做了一些有效但不完全的东西.这是我要求的代码
var facebookAuthenticationOptions = new FacebookAuthenticationOptions()
{
AppId = "...ID",
AppSecret = "...AppSecret",
AuthenticationType = "Facebook",
SignInAsAuthenticationType = "ExternalCookie",
//Provider = new FacebookAuthenticationProvider
//{
// OnAuthenticated = async ctx =>
// {
// if (ctx.User["birthday"] != null)
// {
// ctx.Identity.AddClaim(new Claim(ClaimTypes.DateOfBirth,ctx.User["birthday"].ToString()));
// }
// }
//}
};
facebookAuthenticationOptions.Scope.Add("user_birthday");
//facebookAuthenticationOptions.Scope.Add("first_name");
//facebookAuthenticationOptions.Scope.Add("last_name");
//page goes blank if ask for first_name,last_name , if comment out works
//but doesn give date of birth or likes or other things.
facebookAuthenticationOptions.Scope.Add("publish_stream");
facebookAuthenticationOptions.Scope.Add("user_likes");
facebookAuthenticationOptions.Scope.Add("friends_likes");
facebookAuthenticationOptions.Scope.Add("read_stream");
facebookAuthenticationOptions.Scope.Add("email"); …Run Code Online (Sandbox Code Playgroud) 在 C# 中,当尝试获取类型时,使用下面的代码从文件夹加载 DLL,获取下面的堆栈跟踪。
var assembly = Assembly.LoadFile(assemblyInfo.FullName); // assembly loads perfectly using the absolute path.
var types = assembly.GetTypes(); // this line throws the below stacktrace.
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
Run Code Online (Sandbox Code Playgroud)
我还检查了现有的解决方案:错误消息“无法加载一种或多种请求的类型”。检索 LoaderExceptions 属性以获取更多信息。,在 C# 中运行时加载 DLL(不起作用)
在下面的代码中,我可以从 email@company.com 电子邮件地址成功检索刷新令牌。但是,当我尝试使用 email@outlook.com 登录时,它不会提供刷新令牌,而是返回此响应。
回复:
{
"error": "invalid_grant",
"error_description": "AADSTS70000: The provided value for the 'code' parameter is not valid. The code has expired.\r\nTrace ID: ...\r\nCorrelation ID: ...\r\nTimestamp: 2016-05-19 10:13:05Z",
"error_codes": [
70000
],
"timestamp": "2016-05-19 10:13:05Z",
"trace_id": "8cceb393-....",
"correlation_id": "5227de8...."
}
Run Code Online (Sandbox Code Playgroud)
代码:
private async Task<string> GetRefreshRoken(string authCode, string onSuccessRedirectUri) {
var client = new HttpClient();
var parameters = new Dictionary<string, string>
{
{"client_id", _clientId},
{"client_secret", _clientSecret},
{"code",authCode }, // what retreived from //https://login.microsoftonline.com/common with authroization.
{"redirect_uri", onSuccessRedirectUri}, //http://localhost:27592/Home/Authorize …Run Code Online (Sandbox Code Playgroud) 假设我是Member我不想包含的名称的实体和名单.
var excludeNames = new [] { "A","B","C","D"};
var members = db.Members.Except(excludeNames);
Run Code Online (Sandbox Code Playgroud)
要么
var excludeNames = new[]{ "A","B","C","D"};
var Members = db.Members.Where(m=> excludeNames.Where(xcl => xcl != m.Name));
Run Code Online (Sandbox Code Playgroud)
这些都不起作用.我也试过这个:
var excludeNames = new[] { "A","B","C","D"};
var members = from m in db.Members
from xcl in excludeNames
where m.Name != xcl
select m;
Run Code Online (Sandbox Code Playgroud) asp.net-mvc ×2
c# ×2
access-token ×1
css ×1
dll ×1
dllimport ×1
less ×1
linq ×1
oauth ×1
oauth-2.0 ×1
office365 ×1
outlook ×1
owin ×1
source-maps ×1
t4 ×1