Код: Выделить всё
The exception 'Unable to determine the relationship represented by navigation 'Stock.StockTransactions'Код: Выделить всё
public class Stock
{
public int StockId { get; set; }
...
public virtual List StockTransactions { get; set; } = new();
}
public class StockTransaction
{
public int StockTransactionId { get; set; }
....
public int StockId { get; set; }
public virtual Stock Stock {get;set;}
public int? StockFromId { get; set; }
public virtual Stock? StockFrom { get; set; }
public int? StockToId { get; set; }
public virtual Stock? StockTo { get; set; }
}
Как указать (предпочтительно используя атрибуты), что свойство навигации Stock.StockTransactions относится к StockTransactions.StockId
Подробнее здесь: https://stackoverflow.com/questions/785 ... attributes
Мобильная версия