Пример #1
0
 public void Configure(EntityTypeBuilder <Cart> builder)
 {
     builder.Property(e => e.Records)
     .HasConversion(
         e => SSerializer.Serialize(e),
         e => SSerializer.Deserialize <Dictionary <int, int> >(e));
 }
Пример #2
0
 public void Configure(EntityTypeBuilder <Product> builder)
 {
     builder.Property(e => e.Properties)
     .HasConversion(
         e => SSerializer.Serialize(e),
         e => SSerializer.Deserialize <Dictionary <string, string> >(e)
         );
 }
Пример #3
0
 public void Configure(EntityTypeBuilder <TestEntity> builder)
 {
     builder.HasMany(e => e.SubList);
     builder.HasAlternateKey(e => e.Name);
     builder.Property(e => e.Props).HasConversion(
         e => SSerializer.Serialize(e),
         e => SSerializer.Deserialize <Dictionary <string, string> >(e));
 }
Пример #4
0
        public async Task Auth([FromBody] AuthorizationRequest request)
        {
            var result = await _mediator.Send(request);

            Response.ContentType = "application/json";
            Response.StatusCode  = result.Success ? 200 : 400;
            await Response.WriteAsync(SSerializer.Serialize(result));
        }
Пример #5
0
 public void Configure(EntityTypeBuilder <Employee> builder)
 {
     builder.HasIndex(e => e.Email).IsUnique();
     //builder.Property(e => e.Email).IsRequired();
     builder.Property(e => e.Details)
     .HasConversion(
         e => SSerializer.Serialize(e),
         e => SSerializer.Deserialize <PersonDetails>(e));
 }
Пример #6
0
        public void Configure(EntityTypeBuilder <Order> builder)
        {
            builder.Property(e => e.Address)
            .HasConversion(
                e => SSerializer.Serialize(e),
                e => SSerializer.Deserialize <AddressDetails>(e));

            builder.Property(e => e.Records)
            .HasConversion(
                e => SSerializer.Serialize(e),
                e => SSerializer.Deserialize <Dictionary <int, int> >(e)
                );
        }
Пример #7
0
        public void Configure(EntityTypeBuilder <Customer> builder)
        {
            builder.HasIndex(e => e.Email).IsUnique();
            builder.Property(e => e.Email).IsRequired();
            builder.Property(e => e.Details)
            .HasConversion(
                e => SSerializer.Serialize(e),
                e => SSerializer.Deserialize <PersonDetails>(e));

            builder
            .HasOne(c => c.Cart);
            //.WithOne();

            //builder.Property(e => e.Cart)
            //    .HasConversion(
            //    e => SSerializer.Serialize(e),
            //    e => SSerializer.Deserialize<Cart>(e));
        }