SQL Server Data Tools (SSDT) 通过引入跨 Visual Studio 内所有数据库开发阶段的无所不在的声明性模型,为数据库开发带来变革。创建一个数据库项目进行脱机的数据库开发(不直接对数据库服务进行在线修改),像编辑声明定义一样创建、编辑、重命名和删除表、存储过程、类型和函数。
DECLARE @CSDid uniqueidentifier SELECT @CSDid=NEWID() INSERT INTO [ent].[ScannerGroup] ([ID] ,[Name] ,[ParentID] ,[Type] ,[BrandID] ,[GroupLevel]) SELECT @CSDid ,'CSD' ,null ,10 ,null ,HierarchyID::GetRoot() WHERE NOT EXISTS (SELECT 1 FROM [ent].[ScannerGroup])
INSERT INTO [ent].[PartnerAdmin] ([ID] ,[Email] ,[GroupID] ,[Name]) SELECT NEWID() ,'qqqqq@qqqq.qqq' ,@CSDid ,'QQs' WHERE NOT EXISTS (SELECT 1 FROM [ent].[PartnerAdmin]) GO
Predeployment Scripts & Postdeployment Scripts
Predeployment Scripts和Postdeployment Scripts分别在数据库项目生成的主要部署脚本之前和之后执行,在 Visual Studio 中,从架构比较结果更新目标时(Compare之后的Update),将不执行Predeployment Scripts。 一个项目只能有一个Predeployment Scripts和一个Postdeployment Scripts。
Cannot import the following key file: RightCheckDB.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_E7D8A7C85598CE59
/** The id_token returned from the OIDC provider */ id_token: string; /** The session state value returned from the OIDC provider (opaque) */ session_state?: string; /** The access token returned from the OIDC provider. */ access_token: string; /** Refresh token returned from the OIDC provider (if requested) */ refresh_token?: string; /** The token_type returned from the OIDC provider */ token_type: string; /** The scope returned from the OIDC provider */ scope: string; /** The claims represented by a combination of the id_token and the user info endpoint */ profile: Profile; /** The expires at returned from the OIDC provider */ expires_at: number; /** The custom state transferred in the last signin */ state: any;
/** Calculated number of seconds the access token has remaining */ readonly expires_in: number; /** Calculated value indicating if the access token is expired */ readonly expired: boolean; /** Array representing the parsed values from the scope */ readonly scopes: string[]; }
Microsoft Authentication Library(微软身份认证库MSAL),在ASP和SPA一文中有引用。
The Microsoft Authentication Library for JavaScript enables client-side JavaScript web applications, running in a web browser, to authenticate users using Azure AD. MSAL.js用以浏览器中运行的js web 使用Azure AD认证
The MSAL library for .NET is part of the Microsoft identity platform for developers (formerly named Azure AD) v2.0. It enables you to acquire security tokens to call protected APIs. It uses industry standard OAuth2 and OpenID Connect. The library also supports Azure AD B2C.
authorizationUri Uri URI computed by MSAL.NET that will let the UI extension navigate to the STS authorization endpoint in order to sign-in the user and have them consent
redirectUri Uri The redirect URI that was configured. The auth code will be appended to this redirect URI and the browser will redirect to it.
Open Data Protocol(开放数据协议,OData)是用来查询和更新数据的一种Web协议,其提供了把存在于应用程序中的数据暴露出来的方式。OData运用且构建于很多Web技术之上,比如HTTP、Atom Publishing Protocol(AtomPub)和JSON,提供了从各种应用程序、服务和存储库中访问信息的能力。OData被用来从各种数据源中暴露和访问信息,这些数据源包括但不限于:关系数据库、文件系统、内容管理系统和传统Web站点。
public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddOData(); }
public void Configure(IApplicationBuilder app) { var builder = new ODataConventionModelBuilder(app.ApplicationServices);
builder.EntitySet<Product>("Products");
app.UseMvc(routeBuilder => { // and this line to enable OData query option, for example $filter routeBuilder.Select().Expand().Filter().OrderBy().MaxTop(100).Count();
[HttpGet] [ODataRoute("GetSalesTaxRate(PostalCode={postalCode})")] public IHttpActionResult GetSalesTaxRate([FromODataUri] int postalCode) { double rate = 5.6; // Use a fake number for the sample. return Ok(rate); }
containment
1 2 3 4 5 6 7 8
[EnableQuery] [ODataRoute("Accounts({accountId})/PayinPIs({paymentInstrumentId})")] public IHttpActionResult GetSinglePayinPI(int accountId, int paymentInstrumentId) { var payinPIs = _accounts.Single(a => a.AccountID == accountId).PayinPIs; var payinPI = payinPIs.Single(pi => pi.PaymentInstrumentID == paymentInstrumentId); return Ok(payinPI); }