Link to home
Start Free TrialLog in
Avatar of Rich
Rich

asked on

How can I make this generic?

I have a non-generic way of filling a grid with non-related items.

So, for example I have an entity called Stock and an entity called CustomerTypes

They are both IRepositories.

I have a third entity called StockPrice

This table is very simple – it has a StockId, CustomerTypeId, IsPrimary and StockPrice, Stockname, customertypename

The concept is based off the devexpress project available on github here:
https://github.com/donwibier/DX-MVVM-Magic-Part2

In other words it is ripped and modified from there (The WinForms project)

I have attached a word document showing my code. I'm attempting to make something non-generic to generic but need a helping hand.question.docx
Avatar of ste5an
ste5an
Flag of Germany image

Your terminology is mixed up..

So, for example I have an entity called Stock and an entity called CustomerTypes. They are both IRepositories.
Makes no sense. Read the repository pattern again. They should be data transfer objects or business/domain objects. Same for StockPrice.

A "table"? What do you mean? Your grid (view) or the data storage (persistence)?

Add your code as .cs files or embed them into your post. Using a Word file is non-sense. Craft a concise and complete example before doing so.
Avatar of Rich
Rich

ASKER

You're absolutely right. I do apologise - I was in a rush to get this out the door. As it happens, I got it done but no excuse to just frantically paste code into a word document. This question can be closed.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.