Consider a Customer entity that has a Resource object representing the logo of the customer:
public class Customer
{
public Guid Id { get; set; }
public string CompanyName { get; set; }
public Resource Logo { get; set; }
}
public class Resource
{
public string Uri { get; set; }
public string Name { get; set; }
}
This is what I have tried so far but getting an error because Logo is a complex object:
var customer = modelBuilder.Entity<Customer>().ToTable("Customers");
customer.HasKey(c => c.Id);
customer.Property(c => c.CompanyName).HasColumnName("Company");
customer.Property(c => c.Logo);
How can I store that Resource with EF Core 2.0 as a value object inside the customer table?