locked
DAL-BLL and List question RRS feed

  • Question

  • I have a DAL-BLL question. Basically, I have a some information that im splitting into two tables. Eg. I have a GradeMetadata table and a Students Table. The students table consists of all the students in a school, but it also has a field for the GradeMetada ID, so that way I can track of which kid is in which Grade.

    now in my DAL, I have a

    GradeDetails class and a StudentDetails class.

    namespace DAL
    {
    GradeDetails has the following properties:
        id, gradeName, and a List<studentDetails>

    StudentDetails has the following properties    
         id, studentName, age    (in my insert logic I also populate a column which ahs the gradeDetails id.)
    }


    now in my BLL I inititially had a Grade class as follows:  

    using DAL;
    namespace BLL {
        Grade has the following properties
        Id, GradeName, List<studentDetails>
    }

    During normal usage, I would only want to use    using BLL,
    but what I came to realise is that if I have to create a studentDetails object to pass into Grade..I cant do that cause there is no definition for a studentDetails in BLL.

    So I created a StudentDetails class inside the Grades class like so:
    namespace BLL{
        class Grade 
       {
            Id, GradeName, List<studentDetails>

            class Students
                Id,  StudentName, Age
       }

    }


    but I keep getting this error that in my insertlogic cannot convert from <BLL.Grade.Students> to <DAL.StudentDetails>

    this seems like a valid error message because the compiler doesnt know that the List<studentDetails> and List<Grade.Students> has the identical structure...so how would I get around this?

    thanks
    You are so wise...like a miniature budha covered in fur. -Anchorman
    • Moved by Michael Sun [MSFT]Microsoft employee Wednesday, October 15, 2008 8:48 AM Off Topic for Visual C# General [loc] (Moved from Visual C# General to Off-Topic Posts (Do Not Post Here))
    Sunday, October 12, 2008 12:37 AM

Answers

  •  

    Hello,

     

    Thank you for your post! This is the Off-Topic Posts Forum. I would suggest posting your question in the MSDN > Forums Home > .NET Development > .NET Base Class Library' located here: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/threads/

    Have a great day!

    Thanks!


    SachinW, Tier 2 Application Support, Server and Tools Online Engineering Live Services Team
    • Proposed as answer by SachinW Friday, October 17, 2008 9:51 AM
    • Marked as answer by SachinW Monday, November 10, 2008 6:48 AM
    Friday, October 17, 2008 9:51 AM