Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi there,

First thank you to visit my post ..
I just start my way with Linq so I'm sorry if it's stupid question :(

I have this ERD design ..
http://www.m5zn.com/newuploads/2015/05/02/jpg//6fe7a5567905df0.jpg[^]

also I wrote this class:
http://www.m5zn.com/newuploads/2015/05/02/jpg//184c985526142a3.jpg[^]
C#
public List<DivisionInfo> GetDivisionsInfos()
{
}

DivitionInfo represent the class I wrote above which are:

1- DivId
2- DivName
3- ManagerName (manager name must be bring it from UsersInfo table)
4- Active project.(we will calculate this value from column name ProjIsActive in Projects table).
5- Total Project.(we will calculate this value from column name ProjIsActive in Projects table,which is not active).

So how I can write this function with Linq with Lambda expression??

I know this may be stupid for professionals but I'm student and I have to learn from you ..

Thanks a lot
Posted
Updated 2-May-15 20:41pm
v2
Comments
Sascha Lefèvre 2-May-15 17:42pm    
What are the data sources for the Linq-statement? You say you want a List of DivisionInfo as a result but where should it come from if not from thin air? :)
fahd951 4-May-15 8:21am    
Yes, there is a data source ..
Please click in the links to see the database design.
Also the attributes for DidvtionInfo class.
Tomas Takac 3-May-15 2:45am    
What you are missing is the actual data access. You have your tables in the database, you have the class in your C# code, so now you need to find a way to actually pull the data across the boundary. Do you have a particular data access technology in mind?
fahd951 4-May-15 8:24am    
Yes this is true ..
Actually I use EF technology to interacting with the data in DB
but I need to write that code to retrieve the data from DB and put it
Inside a list with type "DivitionInfo"

please see the pictures in the link for more details ..

Thanks
fahd951 4-May-15 8:24am    
Any Help Developers :(

1 solution

 
Share this answer
 
Comments
fahd951 5-May-15 8:02am    
Thank you Maciej
Maciej Los 5-May-15 8:04am    
You're very welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900