Enmarcha.SharePoint.Entities.Artefacts.ListSharePoint.GetContentType C# (CSharp) Method

GetContentType() public method

Return content type the sharepoint list
public GetContentType ( ) : IEnumerable
return IEnumerable
        public IEnumerable<string> GetContentType()
        {
            try
            {
                var contentTypeCollection = Web.Lists[Name].ContentTypes;

                return (from SPContentType contentType in contentTypeCollection select contentType.Name).ToList();
            }
            catch (Exception exception)
            {
                Logger.Error(string.Concat("Error GetContentType :", exception.Message));
                return null;
            }
        }