У нас есть транзакционная таблица Customer с несколькими таблицами поиска с внешними ключами.Мы хотим, чтобы 3 таблицы соединились.Должен ли репозиторий когда-либо объединять таблицы или он используется только для чтения отдельных таблиц?
Также, если это так, во что репозиторий помещает данные?Я слышал, что он не может знать о Viewmodels и т. Д., К какому типу данных объекта будут относиться результаты?
Репозиторий:
void GetByCustomerTransactionId()
{
var result = from ct in CustomerTransaction
join pt in ProductType on pt.ProductTypeId equals ct.ProductTypeId
join ss in Status on s.StatusId equals ct.StatusId
select new all fields
}
Модели:
public class CustomerTransaction
{
public int CustomerTransactionId{ get; set; },
public int ProductTypeId {get; set; }, //joins to ProductTypeTable
public int StatusID {get; set; }, //joins to StatusTypeTable
public string DateOfPurchase{ get; set; },
public int PurchaseAmount { get; set; },
}
public class ProductType
{
public int ProductTypeId{ get; set; }
public string ProductName { get; set; },
public string ProductDescription { get; set; },
}
public class StatusType
{
public int StatusId{ get; set; }
public string StatusName{ get; set; },
public string Description{ get; set; },
}