Should I create new table for every consistent data set or one system--codes table WHEN using Microsoft Entity framework 6 ?
I mean by the "consistent data set" are like:
+Agent (Table) -Id -Name -Status (consistent data = available | busy | unavailable) -Type (consistent data = reception | delivery | driver) -Gender (consistent data = male | female) -AddressId +Address (Table) -Id -Description -Longitude -Latitude -City (consistent data = [ .... any city .... ]) -State (consistent data = [ .... any state.... ])
My question is should i Have a table for each of Status, Type, Gender,...etc and link them to the "Agent" table using foreign keys and navigational properties ? OR just make one table like this :
+SystemCodeTable -CodeId -CodeParentId -NameAr -NameEn -Description
and save all my consistent data into it and then assign the CodeId to the "Status", "Type", "Gender", ...etc columns ?
I think For Status and Type - better you create StatusMaster and TypeMaster resp.
StatusMaster (StatusID)0 - Available 1 - Busy 2- Unavailable and Use StatusID in Agent Table same you can create for TypeMaster. and for Gender you can directly use 'M' and 'F' or 'Male' and 'Female' as it is in Agent table.
Hope this will help you.