This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sdk": { | |
"version": "8.0.0", | |
"rollForward": "latestFeature" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sdk": { | |
"version": "6.0.0", | |
"rollForward": "latestFeature" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE [dbo].[READBYKEYS] ( | |
@list IntListType READONLY, | |
@user NVARCHAR(50), | |
) | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
//We should log every attempt to query this datasource | |
INSERT INTO AUDIT_LOG (@user, @list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @list IntListType; INSERT INTO @list (Value) VALUES (1), (2), (3), (4), (5); | |
EXEC READBYKEYS @list=@list, @user=‘BaWu’; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TYPE IntListType AS TABLE ( | |
Value INT NOT NULL PRIMARY KEY | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE [dbo].[READBYKEYS] ( | |
@list NVARCHAR(MAX), | |
@user NVARCHAR(50), | |
) | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
//We should log every attempt to query this datasource | |
INSERT INTO AUDIT_LOG (@user, @list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE [dbo].[READBYKEYS] ( | |
@list NVARCHAR(MAX), | |
@user NVARCHAR(50), | |
) | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
-- Temporary table to hold IDs from the list | |
DECLARE @hastable TABLE (Id BIGINT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class CategoryReadModeldMap : IEntityTypeConfiguration<CategoryReadModel> | |
{ | |
public void Configure(EntityTypeBuilder<CategoryReadModel> builder) | |
{ | |
builder..ToView("Categories") //Required to map model to an already mapped table | |
.Property(x => x.Id).HasColumnName("CategoryID"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class Category:Entity | |
{ | |
public string CategoryName { get; set; } | |
public string Description { get; set; } | |
public byte[] Picture { get; set; } | |
public IList<Product> Products { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string apiEndpoint = "https://localhost:7002/weatherforecast/"; | |
var client = new HttpClient(); | |
// Call the WeatherForecast API | |
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); | |
var apiResponse = await client.GetAsync(apiEndpoint); | |
apiResponse.EnsureSuccessStatusCode(); | |
var weatherData = await apiResponse.Content.ReadAsStringAsync(); |
NewerOlder