none
Partial class/methods question RRS feed

  • Question

  • I am a few difficulties in using partial methods with VB .Net and suspect its the way I've structured my project. I have an ASP .Net project. Create a new class library project (called Linq) and add a Sql to Linq class. Drag my tables into this file.

    I then create another class library project, and add a reference to the above project (Linq) and write a couple of simple Linq queries.

    Question is where should the Partial Class reside? Should it reside under the Linq class library or the second class library i created? How do you guys structure your layers?

    Thanks

    Tuesday, December 18, 2012 3:01 PM

Answers

  • The reason why LINQ creates partial classes is that it gives you ability extend it. Continue coding without creation additional class which carries the same functionality as LINQ.

    Basically you don't need to create two Class Libraries for handling LINQ and Application layer. Keep all the in the same library it will simplify your life.


    Please Mark as Reply and Vote as Helpful if I helped.

    Also please visit my blog http://msguy.net/

    • Marked as answer by Pure Deal Wednesday, December 19, 2012 8:00 PM
    Wednesday, December 19, 2012 9:08 AM

All replies

  • Some Remarks about the Partiacl class

    Using the partial keyword indicates that other parts of the class, struct, or interface can be defined within the namespace. All the parts must use the partial keyword. All of the parts must be available at compile time to form the final type. All the parts must have the same accessibility, such as public, private, and so on.

    If you want more information about the Partical class Please check the following urls

    http://msdn.microsoft.com/en-us/library/wa80x488(v=vs.80).aspx

    http://www.codeproject.com/Articles/313352/4-real-time-use-of-Partial-classes-and-partial-met


    With Thanks and Regards
    Sambath Raj.C
    click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you
    Happy Programming!

    Wednesday, December 19, 2012 4:29 AM
  • The reason why LINQ creates partial classes is that it gives you ability extend it. Continue coding without creation additional class which carries the same functionality as LINQ.

    Basically you don't need to create two Class Libraries for handling LINQ and Application layer. Keep all the in the same library it will simplify your life.


    Please Mark as Reply and Vote as Helpful if I helped.

    Also please visit my blog http://msguy.net/

    • Marked as answer by Pure Deal Wednesday, December 19, 2012 8:00 PM
    Wednesday, December 19, 2012 9:08 AM