Я пытаюсь создать эту сущность: < /p>
public class UserIBANInfo
{
public UserIBANInfo(string iban)
{
IBAN = iban;
}
[Key]
public string IBAN { get; set; }
}
< /code>
Для этой таблицы: < /p>
CREATE TABLE UserIBANInfos
(
IBAN CHAR(20) PRIMARY KEY
);
< /code>
Но когда я пытаюсь сделать это, я получаю эту ошибку: < /p>
Unhandled exception. System.InvalidOperationException: No suitable constructor was found for entity type 'UserIBANInfo'. The following constructors had parameters that could not be bound to properties of the entity type:
Cannot bind 'iban' in 'UserIBANInfo(string iban)'
Подробнее здесь: https://stackoverflow.com/questions/758 ... ructors-ha
Мобильная версия