RudiVisser's Profile User Rating: -----

Reputation: 1009 Grandmaster
Active Posts:
3,575 (1.42 per day)
05-June 09
Profile Views:
Last Active:
User is offline Jun 26 2015 05:11 AM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Dream Kudos:
Expert In:

Latest Visitors

Icon   RudiVisser has not set their status

Posts I've Made

  1. In Topic: Domain Model and Entity Framework

    Posted 26 Jun 2015

    Alright - 2 things.

    1; Your EF Model can be simplified massively
    I'm not sure why you're using the model builder other than to conform to some tutorial, but it's simply not required. The code below has the same effect.

    I suggest you do the following things:
    • Look into what's provided by System.ComponentModel.DataAnnotations.Schema
    • Use generic interfaces for collections (ICollection<T>) in your entities (not so required)
    • Use lazy-loading on your POCOs so as to reduce the time taken to initially load from DB, further results off these navigation properties (disregarding use of Include) will be loaded when you use them

        public class Student
            public int StudentID { get; set; }
            public string StudentName { get; set; }
            public DateTime? DateOfBirth { get; set; }
            public decimal Height { get; set; }
            public decimal Weight { get; set; }
            public int StandardKey { get; set; }
            public virtual Standard Standard { get; set; }
            public override string ToString()
                return "Student Name = " + StudentName + " Standard = " + Standard.ToString();
        public class Standard
            public int StandardId { get; set; }
            public string StandardName { get; set; }
            public ICollection<Student> Students { get; set; }
            public override string ToString()
                return StandardName;
        public class SchoolContext : DbContext
            public SchoolContext()
                : base("Data Source=localhost; Initial Catalog=TestingPurposeDB; Integrated Security=true") { }
            public DbSet<Student> Students { get; set; }
            public DbSet<Standard> Standards { get; set; }

    2; Why do you want to further separate into 3 layers?
    Don't do it just because you read somewhere that it's best.

    Entity Framework stays out of the way for the most part, which is why they are called "POCO"s (ie. Plain Old Code Objects) allowing you to use EF's Entities as standard classes in your application too.

    The only time I can foresee requiring another layer is if your data models are entirely standalone and in another assembly (For example a Project.DataModels.dll assembly) and you need to provide additional functionality above this data. Even then, I'd suggest simply inheriting from these data models so as to not create another layer per se.

    Note that partial does not mean what you think it means. Partial is not extending your methods nor creating another layer, it's simply spreading the class declaration across multiple files. I'd suggest you don't do this.

    If you're sure that you need to do what you're saying and create an additional layer, then let us know what you tried to do with your partial class.
  2. In Topic: Domain Model and Entity Framework

    Posted 26 Jun 2015

    Methods on your EF POCO will work just fine as per the "Domain Model". You can do far more complex things on your POCO that you want your application to utilise, but EF to ignore.

    The problem seems more that nothing is being returned from your call to SingleOrDefault.

    Could you please verify by debugging if result is actually your object or not?
  3. In Topic: MVC , dropdown lsit

    Posted 15 May 2014

    What is your problem, what have you tried exactly?

My Information

Member Title:
.. does not guess solutions
25 years old
November 20, 1990
Manchester, UK
Full Name:
Rudi Visser
Years Programming:
Programming Languages:


  • (2 Pages)
  • +
  • 1
  • 2
  1. Photo

    sexie gal Icon

    09 Mar 2012 - 11:34
    Why do we need temporarycodes
  2. Photo

    E_Geek Icon

    11 Sep 2011 - 12:50
    :O I'm waiting on my free professional design! My big bruv told me it would be done by the time I start uni, which is friday, but I have a sneaky suspicion he may have been lying, since he told me it would be done next weekend :|
  3. Photo

    calvinthedestroyer Icon

    06 Sep 2011 - 19:40
    $10 say's that's not you in your profile pic smooching some girl :P
  4. Photo

    e_i_pi Icon

    06 Sep 2011 - 00:11
    Congrats on the promo!
  5. Photo

    Dormilich Icon

    05 Sep 2011 - 04:28
    Congratulation to your promotion!
  6. Photo

    codeprada Icon

    02 Sep 2011 - 11:38
    Congratz on the promotion.It was well deserved.
  7. Photo

    Dormilich Icon

    12 Aug 2011 - 01:23
    for your session tutorial:
  8. Photo

    codeprada Icon

    05 Aug 2011 - 10:09
    Pretty good blog you got there ;)
  9. Photo

    EnvXOwner Icon

    22 Jul 2011 - 12:37
    No problem :)
  10. Photo

    EnvXOwner Icon

    22 Jul 2011 - 05:59
    Hey man, your site's awesome. I could suggest that you increase the line-height. In the recent news section the letters are touching each other.
  11. Photo

    gabehabe Icon

    28 Jun 2011 - 03:24
    LUV U
  12. Photo

    pwz2000 Icon

    25 Mar 2011 - 07:31
    I was looking for a coder who could finish a humor website in six months of time.
  13. Photo

    pwz2000 Icon

    25 Mar 2011 - 07:24
    I sent you a e-mail to your MSN id about freelance opportunity,
  14. Photo

    gabehabe Icon

    10 Mar 2011 - 09:28
    Ruuuuuuudiiiiiiiiii!!! <333333333
  15. Photo

    nick1200 Icon

    07 Nov 2010 - 09:40
    would you be able to code me a new pokemon rpg ? if so how much would i have to pay :)
  • (2 Pages)
  • +
  • 1
  • 2