Skip to content

Instantly share code, notes, and snippets.

{
"sdk": {
"version": "8.0.0",
"rollForward": "latestFeature"
}
}
{
"sdk": {
"version": "6.0.0",
"rollForward": "latestFeature"
}
}
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)
DECLARE @list IntListType; INSERT INTO @list (Value) VALUES (1), (2), (3), (4), (5);
EXEC READBYKEYS @list=@list, @user=‘BaWu’;
CREATE TYPE IntListType AS TABLE (
Value INT NOT NULL PRIMARY KEY
);
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)
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);
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");
}
}
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; }
}
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();