Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
namespace Grand.SharedKernel.Extensions;
public static class FileExtensions
{
public static IList<string> GetAllowedMediaFileTypes(string allowedFileTypes)
{
if (string.IsNullOrEmpty(allowedFileTypes))
return new List<string> { ".gif", ".jpg", ".jpeg", ".png", ".bmp", ".webp" };
return allowedFileTypes.Split(',').Select(x => x.Trim().ToLowerInvariant()).ToList();
}
public static bool IsAllowedMediaFileType(this IEnumerable<string> allowedFileTypes, string fileExtension)
{
return allowedFileTypes.Any(ft => ft.Equals(fileExtension, StringComparison.OrdinalIgnoreCase));
}
}