Код: Выделить всё
public partial class TableA
{
public int TableAId { get; set; }
}
public partial class TableB
{
public int TableBId { get; set; }
}
Код: Выделить всё
public interface IId
{
int Id { get; set; }
}
public partial class TableA : IId
{
int IId.Id { get => this.TableAId; set => this.TableAId = value; }
}
public partial class TableB : IId
{
int IId.Id { get => this.TableBId; set => this.TableBId = value; }
}
Примечание: базовая база данных — SQL Server
Подробнее здесь: https://stackoverflow.com/questions/790 ... ty-classes
Мобильная версия