powered by simpleCommunicator - 2.0.49     © 2025 Programmizd 02
Форумы / ADO.NET, LINQ, Entity Framework, NHibernate, DAL, ORM [игнор отключен] [закрыт для гостей] / Mapping. Code first. The number of properties in the Dependent and Principal Roles in a r
1 сообщений из 1, страница 1 из 1
Mapping. Code first. The number of properties in the Dependent and Principal Roles in a r
    #39109285
Pavluha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Это вью на таблицу многие ко многим.
Вот сам код вью
Код: plsql
1.
2.
3.
4.
5.
6.
7.
ALTER VIEW [dbo].[VTypeObject] AS
SELECT A.*, C.* FROM TypeObject A
INNER JOIN TypeObject2Nsi B
ON A.IdObject = B.IdObject
INNER JOIN TypeAndVersionNsi C
ON B.IdNsi = C.IdNsi
GO



Мэпинг
Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
public class TypeObject
    {
        public int IdObject { get; set; } // IdObject
        public string ObjectName { get; set; } // ObjectName
        public int IdNsi { get; set; } // IdNsi
        public string NsiName { get; set; } // NsiName
        public Guid СurrentVersion { get; set; } // СurrentVersion
    }

    public class TypeObjectConfiguration : EntityTypeConfiguration<TypeObject>
    {
        public TypeObjectConfiguration()
            : this("dbo")
        {
        }

        public TypeObjectConfiguration(string schema)
        {
            ToTable(schema + ".VTypeObject");
            HasKey(x => new { x.IdObject, x.ObjectName, x.IdNsi, x.NsiName, x.СurrentVersion });

            Property(x => x.IdObject).HasColumnName("IdObject").IsRequired().HasColumnType("int");
            Property(x => x.ObjectName).HasColumnName("ObjectName").IsRequired().IsUnicode(false).HasColumnType("varchar").HasMaxLength(50);
            Property(x => x.IdNsi).HasColumnName("IdNsi").IsRequired().HasColumnType("int");
            Property(x => x.NsiName).HasColumnName("NsiName").IsRequired().IsUnicode(false).HasColumnType("varchar").HasMaxLength(50);
            Property(x => x.СurrentVersion).HasColumnName("СurrentVersion").IsRequired().HasColumnType("uniqueidentifier");
        }
    }



Получаю ошибку: The number of properties in the Dependent and Principal Roles in a r.
Что не так?
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / ADO.NET, LINQ, Entity Framework, NHibernate, DAL, ORM [игнор отключен] [закрыт для гостей] / Mapping. Code first. The number of properties in the Dependent and Principal Roles in a r
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]