public void Configure(EntityTypeBuilder <Cart> builder) { builder.Property(e => e.Records) .HasConversion( e => SSerializer.Serialize(e), e => SSerializer.Deserialize <Dictionary <int, int> >(e)); }
public void Configure(EntityTypeBuilder <Product> builder) { builder.Property(e => e.Properties) .HasConversion( e => SSerializer.Serialize(e), e => SSerializer.Deserialize <Dictionary <string, string> >(e) ); }
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)); }
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)); }
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)); }
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) ); }
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)); }