Hi im learning Dependency Injection for the first time and making a micro-project to try it out. But I have a model class in my main project and a class from that model is needed in the service interface however im unable to import the model class in the interface.
namespace ASPNETCoreLearn2.Models{ public class CityWeather { public string CityUniqueCode { get; set; } public string CityName { get; set; } public DateTime DateAndTime { get; set; } public int TemperatureFahrenheit { get; set; } }}
namespace ASPNETCoreLearn2.Models{ public class CityWeather { public string CityUniqueCode { get; set; } public string CityName { get; set; } public DateTime DateAndTime { get; set; } public int TemperatureFahrenheit { get; set; } }}
using ASPNETCoreLearn2.Models; //TYPE OR NAMESPACE COULD NOT BE FOUNDnamespace ServiceContracts{ public interface IWeatherService { public List<CityWeather> GetWeatherDetails(); }}
using ASPNETCoreLearn2.Models; //TYPE OR NAMESPACE COULD NOT BE FOUNDnamespace ServiceContracts{ public interface IWeatherService { public List<CityWeather> GetWeatherDetails(); }}
I can import ServiceContracts in ASPNETCoreLearn2 but i can't do vice-versa even though ive properly added the project dependencies.