armin656
یک شنبه 24 مرداد 1395, 12:49 عصر
public class AA : IABC
{
public string z {get; set;}
}
public class BB : IABC
{
public int x {get; set;}
}
public interface IABC
{
}
public interface IFoodFacts<T> where T : IABC
{
List<T> GetReport(WS_GroupsFilterDTO Filter_OBJ, ref ReportInfoDTO rptInfo);
}
public class FoodFactsFactory
{
public IFoodFacts<IABC> GetFoodFactsInstance(ReportingType.rpt_FoodFacts WhichReport)
{
switch (WhichReport)
{
case 1 :
case 2 :
return new WeeklySeparating(WhichReport);
}
return null;
}
}
public class WeeklySeparating : IFoodFacts<AA>
{
public List<AA> GetReport(WS_GroupsFilterDTO Filter_OBJ, ref ReportInfoDTO rptInfo)
{
return null;
}
}
در قسمت switch case خطای convert type رو میده
{
public string z {get; set;}
}
public class BB : IABC
{
public int x {get; set;}
}
public interface IABC
{
}
public interface IFoodFacts<T> where T : IABC
{
List<T> GetReport(WS_GroupsFilterDTO Filter_OBJ, ref ReportInfoDTO rptInfo);
}
public class FoodFactsFactory
{
public IFoodFacts<IABC> GetFoodFactsInstance(ReportingType.rpt_FoodFacts WhichReport)
{
switch (WhichReport)
{
case 1 :
case 2 :
return new WeeklySeparating(WhichReport);
}
return null;
}
}
public class WeeklySeparating : IFoodFacts<AA>
{
public List<AA> GetReport(WS_GroupsFilterDTO Filter_OBJ, ref ReportInfoDTO rptInfo)
{
return null;
}
}
در قسمت switch case خطای convert type رو میده