Create a List<string> generic method to return my object entity as List string in MVC C# RRS feed

  • Question

  • User-1347841061 posted

    How to can get data as list<string> in a dynamic method generic

    public List<string> GetCreativePatternMatchedSupplier<T>(string name, int id)


    var matchedNamesModel = new List<string>();

    var listOfExistingNames = .......Where(lpc => lpc.Id != id).Select(lpc => lpc.Name).Distinct();

    foreach(var nameinDb in listOfExistingNames){



    return matchedNamesModel.Distinct().ToList();


    Monday, October 27, 2014 1:33 PM


All replies