View LazyLoadLog.cs
class Program
{
static void Main(string[] args)
{
using (var context = new MyContext())
{
var parentId = Guid.NewGuid();
context.Parents.Add(new ParentEntity(null)
{
Id = parentId,
View entities.cs
public class ParentEntity
{
private readonly Action<object, string> _lazyLoader;
public Guid Id { get; set; }
public string Name { get; set; }
private List<ChildEntity> _children;
public List<ChildEntity> Children
{
View s3.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddDataProtection()
.PersistKeysToAwsS3(new AmazonS3Client(), new S3XmlRepositoryConfig("bucketName")
{
KeyPrefix = "DataProtectionKeys/",
});
services.AddMvc();
}
View redis.cs
public void ConfigureServices(IServiceCollection services)
{
var redis = ConnectionMultiplexer.Connect("your connection here");
services.AddDataProtection().PersistKeysToRedis(redis, "DataProtectionKeys");
services.AddMvc();
}
View azure.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddDataProtection()
.PersistKeysToAzureBlobStorage(new Uri("your uri goes here"));
services.AddMvc();
}
View UseForwardedHeaders.cs
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedProto
});
View nolink.json
View link.json
View handler.cs
public class AlbumAddedToCartHandler
: INotificationHandler<AlbumAddedToCart>
{
private readonly ILogger<AddToCart> _logger;
public AlbumAddedToCartHandler(ILogger<AddToCart> logger)
{
_logger = logger;
}
View notification.cs
public class AlbumAddedToCart : INotification
{
public int AlbumId { get; }
public AlbumAddedToCart(int albumId)
{
AlbumId = albumId;
}
}