HobbyProject/Source Code/TeamHobby.HobbyProjectGenerator.Archive/RelationalDataSourceFactory.cs
Lunastra 1828f5acbb Added a main to test stuffs
Change return type for Datasource interface.
Add file compression method.
2021-12-04 18:23:15 -08:00

34 lines
861 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TeamHobby.HobbyProjectGenerator.Archive;
namespace TeamHobby.HobbyProjectGenerator.Archive
{
public class RelationalDataSourceFactory
{
// Mehthod to create a specific data source suitable to the need
public IDataSource? getDataSource(string name)
{
try
{
if (String.Equals(name, "SQL", StringComparison.OrdinalIgnoreCase))
{
return new SQLSource();
}
else
{
return null;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
}
}
}