Model ===>
public class CountryModel
{
public int CountryID { get; set; }
public string CountryCode { get; set; }
public string CountryName { get; set; }
public string Continent { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }
}
public class StateModel
{
public int StateID { get; set; }
public string StateCode { get; set; }
public string StateName { get; set; }
public int CountryID { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }
public CountryModel countryModel { get; set; }
}
Service Class ==>
IQueryable<StateModel> IService<StateModel>.GetQueryable()
{
// Getting list from State table and Country table from DB
// Relationship between Country and State Table
IList<State> wsEF = stateRepository.GetAll(); ...
Go to the complete details ...