I am in the process of developing a web application with asp.net MVC. I am using Entity Framework to make a connection to my database.
I am having trouble with a specific concept in my program. I will explain below.
I have a Network class which resembles a network in real life which has a frequency.
I then have a Block class. A block is a certain section of devices on a networks.
I also have a Customers Class.
Here are my current Models of the above classes:
Network:
public class Network
{
public int networkID { get; set; }
public String name { get; set; }
public int startCode { get; set; }
public decimal frequency { get; set; }
public virtual List<Block> blocks { get; set; }
}
Customer:
public class Customer
{
public int customerID { get; set; }
public String name { get; set; }
public String shortName { get; set; }
}
Block:
public class Block
{
public int blockID { get; set; }
public decimal start { get; set; }
public int end { get; set; }
public int blockSize { get; set; }
public Customer customer { get; set; }
}
Ok now my problem comes with this.
A network has many blocks. Each block belongs to a single client. A client may have many blocks in one network, and can also have many blocks in many networks.
Is my above configuration correct / sufficient to store my certain scenario. But I also then need to be able To browse a client and query all his blocks which he has.