Search results for query: *

  1. M

    Question Same query fired multiple times EF

    The only thing is, assume this is a massive database table, then it's copying the entire table into memory. Isn't this very bad performance-wise? Probably still better than letting it excecute the same query 3 times, cause in theory it's possible that between excecution of the queries the...
  2. M

    Question Same query fired multiple times EF

    Thanks for the explanation! So as you suggest, I could use ToArray(), or ToList() and this wil execute the query one time and then this generared array is used in the view. But it's not that this is bad practice or something?
  3. M

    Question Same query fired multiple times EF

    I'm building a very simple CRUD web-application (ASP.NET MVC) for tennisplayers and the tournaments they can participate. On a specific page I want to show all tournaments in the database with a title at the top op the page 'All Tournaments' with between brackets the amount of records in the...
  4. M

    EF returning old data

    Hi everyone, I'm making a very simple CRUD console application using EF and sqlite. I have 3 domain model classes, being: Player, Tournament and TournamentEnrollment public class Player { [Key] public int Id { get; set; } [Required] public string...
  5. M

    Resolved EF VS in memory list and the initialization of navigation properties

    You put me on the right track and after looking it in some more detail, it's indeed one of the tasks of the ORM (in this case EF) to initialize the navigation properties when they are not already initialized. I also learned that even when you don't make a DbSet for one of your domain models, but...
  6. M

    Resolved EF VS in memory list and the initialization of navigation properties

    I have a question regarding navigation properties in EF and it's initialization. I created a small case to clarify the issue I'm dealing with. Sorry for the extreme long post but I like to be clear :). Under my InMemoryRepository class I created 2 lists, being ‘Tickets’ and ‘TicketResponses’...
  7. M

    Beginners question regarding AsEnumerable()

    Thanks all! So as I assumed there is no specific need to add the AsEnumerable?
  8. M

    Beginners question regarding AsEnumerable()

    I'm following a EF Core (beginners) course and there is something I don't understand. Below you can find the most important classes of a little excercise we got, to get to know EF core and the intent. public class Student { public int StudentId { get; set; } public string...
  9. M

    Question Simple CRUD application to learn the n-tier architecture

    Alriht, thanks! So in theory the example I made is a correct n-tier application?
  10. M

    Question Simple CRUD application to learn the n-tier architecture

    Hi everyone! I want to use the n-layer architecture for a very simple CRUD console application. I have a domain layer, presentation layer (a console application), a business layer and a data acces layer. If I'm right, the DAL is used to interact with a database, and the BL is a layer between the...
  11. M

    Resolved Question regarding the instantiation of object in class

    I want to thank you for the clear explanation and in the mean time I learned a lot of new things. It helped me a lot!
  12. M

    Resolved Question regarding the instantiation of object in class

    I'm new to the SRP, and quite a newbie :). But imagine a class Author and a class Book. A book does have an author so a book class contains a author object, right? Following SRP I may not declare an author object in the book clas? I find it quite strange certainly for a beginner in OOP.
  13. M

    Resolved Question regarding the instantiation of object in class

    But a Tennisplayer still have a Club object, right? so if I keep the members list in a private field, it's correct that I can no longer alter the list directly, but now I can alter the list by using the public methods add/remove members. This way a TennisPlayer object cann still alter a club.
  14. M

    Resolved Question regarding the instantiation of object in class

    I understand I have to work with properties, but I can' manage to secure the list members of the club class. public class Club { public string Name; public List<TennisPlayer> Members { get; } public Club(string name) { Name = name...
  15. M

    Resolved Question regarding the instantiation of object in class

    Thanks for your answer. Now I know I'm on the good track. Now assume that class Club has an extra field Name (the name of the club). Imagine I create a Club object 'c' and a Tennisplayer object 't'. By using the constructor of the t I link t to c. Trough t I can now reach c and acces the...
  16. M

    Resolved Question regarding the instantiation of object in class

    Hi erveryone, I got a question I want to clarify by using an example. I have a Club class and a TennisPlayer class. A club can have many tennisplayers as members to that club, and a tennisplayer can only be member at one club at a time. My classes would look like this. I simplified the classes...
  17. M

    Answered explicit cast vs Convert.to()

    Hi! Can someone explain me the difference between: class Program { static void Main(string[] args) { int number = 10; double dNumber = System.Convert.ToDouble(number); } } And: class Program { static void...
  18. M

    The is keyword and its result

    Hi everyone, I started learning C# and got totaly confused by the behaviour of the is keyword. I understand that in the example below the value for b will be true: int number = 10; bool b = number is int; In underneath example the value for for b will be false: int number = 10; bool b =...
  19. M

    Resolved Value types and reference types

    I understan. Thank you very much!
  20. M

    Resolved Value types and reference types

    Alright! I think I understand it. Thank you very much!
Back
Top Bottom