CryptoFutures

Platformy i giełdy

Identyfikacja Trendów

Identyfikacja Trendów w Handlu Kontraktami Futures na Kryptowaluty Identyfikacja trendów jest kluczową umiejętnością w handlu kontraktami futures na kryptowaluty. Zrozumienie, jak rozpoznawać i interpretować trendy,…

Identyfikacja Trendów — Platformy i giełdy, CryptoFutures

Identyfikacja Trendów w Handlu Kontraktami Futures na Kryptowaluty

Identyfikacja trendów jest kluczową umiejętnością w handlu kontraktami futures na kryptowaluty. Zrozumienie, jak rozpoznawać i interpretować trendy, może znacząco wpłynąć na skuteczność Twoich strategii handlowych. W tym artykule omówimy podstawowe koncepcje związane z identyfikacją trendów, narzędzia analizy techniczTitle: Unable to determine the relationship represented by navigation property 'SomeEntity.SomeRelatedEntity' of type 'SomeRelatedEntity'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. username_0: I have the following issue when trying to run some migrations. I think the issue is related to the fact that I have a class that has a property that references another class, but this property is not directly a navigation property (it's not a collection of the other entity, neither it is a direct reference to the other entity). Instead, it has a type of an interface, which might be implemented by the other entity. Here are the details:

The entities:

public class SomeEntity : IEntity
{
 public int Id { get; set; }
 public int? SomeRelatedEntityId { get; set; }
 public ISomeRelatedEntity SomeRelatedEntity { get; set; }
}

public class SomeRelatedEntity : ISomeRelatedEntity, IEntity
{
 public int Id { get; set; }
}

The interfaces:

public interface IEntity
{
 int Id { get; set; }
}

public interface ISomeRelatedEntity
{
}

The fluent configuration in the OnModelCreating method:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
 modelBuilder.Entity<SomeEntity>(entity =>
 {
 entity.HasOne(e => e.SomeRelatedEntity)
 .WithMany()
 .HasForeignKey(e => e.SomeRelatedEntityId);
 });
}

When I run Add-Migration, I get the following error:

Unable to determine the relationship represented by navigation property 'SomeEntity.SomeRelatedEntity' of type 'ISomeRelatedEntity'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

Is there a way to make this work without changing the property type to SomeRelatedEntity? I would like to keep it as ISomeRelatedEntity for abstraction purposes. username_1: @username_0 EF Core does not support mapping interfaces. See https://github.com/dotnet/efcore/issues/9630 for more information. The reason for this is that it isn't clear what concrete type should be mapped. For example, if you have another type implementing the interface, which type should be used? What if two types implement the interface? Which one should be used? What if one type is added later? Should it be automatically picked up? Etc.

The way to work around this is to add a shadow property to the entity type for the concrete type that should be used. For example:

```C modelBuilder.Entity(entity => { entity.Property("SomeRelatedEntity");

entity.HasOne(e => e.SomeRelatedEntity) .WithMany() .HasForeignKey(e => e.SomeRelatedEntityId); }); ```

Polecane platformy handlu kontraktami futures

Platforma Funkcje futures Rejestracja
Bybit Futures Dźwignia do 125x, kontrakty USDⓈ-M Zarejestruj się teraz
BingX Futures Handel kopiujący dla futures Dołącz do BingX
Bitget Futures Kontrakty z marżą USDT Otwórz konto
Pionex Futures Wbudowane boty handlowe, kontrakty perpetual USDⓈ-M Zarejestruj się w Pionex

Dołącz do społeczności

Zasubskrybuj kanał Telegram @strategybin po więcej informacji. Najbardziej zyskowna platforma kryptowalut - zarejestruj się tutaj.

Weź udział w naszej społeczności

Zasubskrybuj kanał Telegram @Crypto_futurestrading dla analiz, darmowych sygnałów i więcej!

Platformy handlu kontraktami futures na kryptowaluty