Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm making an application to learn more about .NET Core and I figured out I need to save my data, and as I know nothing about SQL I'm using entity core framework with code first approach.



My objective is to take input of 37 numbers, and as they increment, display stats for red, black and green.

How should I design my class and properties to make an efficient table?

My concern is how can I make this scalable as I could next add odd\even, individual number percentages as well and maybe someone with foresight could guide me in the right direction ^^


What I have tried:

public class NumberStats
{
    [Key]
    public int Id { get; set; }
    [Required]
    [Range(0,36, ErrorMessage = "Whole Numbers between 0 and 36.")]
    public int Number { get; set; } // We will have a total of 37 numbers here.
    public int Quantity { get; set; } // We count each number, Color, parity, hot\cold to make statistic in percentage
    //public string Color { get; set; } // Can be Red, Black or Green.
    //public string EvenOdd { get; set; } // Can be Even or Odd
    //public string HotCold { get; set; } // To make the top 3 Hot, and top bottom Cold numbers
    //public int Percentage { get; set; } // To hold statistics

    // We know that colors, odds and even are constant values as well as numbers range between 0 - 36
}
Posted
Updated 19-Dec-21 7:09am

1 solution

The usual (learning) path is you "learn by example". After that, you can try your own designs.

Getting Started - EF Core | Microsoft Docs[^]
 
Share this answer
 

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