WriterFactory refactoring
This commit is contained in:
parent
0fcc632024
commit
dcd42a32eb
@ -11,14 +11,10 @@ public class WriterFactory
|
||||
|
||||
public IWriter GetWriter(string writerName)
|
||||
{
|
||||
if (writerName.Equals("Dxf"))
|
||||
return writerName switch
|
||||
{
|
||||
return (IWriter)_serviceProvider.GetService(typeof(DxfWriter));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return (IWriter)_serviceProvider.GetService(typeof(ExcelWriter));
|
||||
}
|
||||
"Dxf" => (IWriter)_serviceProvider.GetService(typeof(DxfWriter)),
|
||||
_ => (IWriter)_serviceProvider.GetService(typeof(ExcelWriter))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user