Releases: D-Diyare/FluentExtensions
Releases · D-Diyare/FluentExtensions
FluentExtensions 1.6
Newly added extensions
// Converts Generic type into CSV file.
void ToCSV<T>(this T entity, string path, bool append = false);
// Converts Generic type into CSV file asynchronously
Task ToCSVAsync<T>(this T entity, string path, bool append = false);
// Converts Generic list type into CSV file asynchronously
void ToCSV<T>(IEnumerable<T> entities, string path, bool append = false);
// Converts Generic list type into CSV file asynchronously
Task ToCSVAsync<T>(IEnumerable<T> entities, string path, bool append = false);
FluentExtensions 1.5
Newly added extensions
// Converts generic type to xml content file.
void ToXml<T>(this T entity, string path);
// Converts generic type to xml content file.
void ToXml<T>(this T entity, string path, Encoding encoding);
// Converts generic type to xml content file.
void ToXml<T>(this T entity, string path, Formatting formatting, int indentation = 4);
// Converts generic type to xml content file.
void ToXml<T>(this T entity, string path, Encoding encoding, Formatting formatting, int indentation = 4);
// Reads xml content file as generic type.
T FromXml<T>(this string path);
// Generate a new guid and returns it as a string.
static string FromGuid(this string empty);
// Converts boolean value to either "yes" or "No".
string ToYesNo(this bool source, string pattern);
FluentExtensions 1.4
Newly added extensions
// Converts boolean value to either "yes" or "No".
string ToYesNo(this bool source);
// Executes an action while the given boolean value is equal to target value.
void DoOn(this bool source, bool result, Action execute);
// Reads the file content as array of bytes.
byte[] ReadBytesFromDisk(this string filePath);
// Reads the file content as array of bytes asynchronously.
Task<byte[]> ReadBytesFromDiskAsync(this string filePath)
// Joins string array into a single string separated via delimiter.
string Join(this IEnumerable<string> texts, string delimiter);
// Converts IEnumerable to list, if it is already a List it returns the list itself.
IList<T> AsList<T>(IEnumerable<T> sourceList);
FluentExtensions 1.3
Newly added extensions
// Gets the free space of the given drive in gigabytes.
string DriveFreeSpace(this string driveLetter);
// Gets the total size of the given drive in gigabytes.
string DriveTotalSize(this string driveLetter);
// Gets the total size of the given drive in gigabytes.
string DriveTotalSize(this string driveLetter);
// Gets the format of the given drive.
string DriveFormat(this string driveLetter);
// Gets the type of the given drive.
DriveType DriveType(this string driveLetter);
// Delete the given file from disk.
void DeleteFile(this string filePath);
// Hides the given file from disk.
void HideFile(this string filePath);
// Shows the given file from the disk (if it's already hidden).
void ShowFile(this string filePath);
// Gets the date and time when this given file was created.
DateTime CreatedDate(this string filePath);
// Copies the file to the given destination (overwrites it if it already exists).
void CopyFile(this string filePath, string destination);
// Moves the file to the given destination (overwrites it if it already exists).
void MoveFile(this string filePath, string destination);
// Gets the file size in kilobytes.
double FileSizeInKB(this string filePath);
// Gets the file size in megabytes.
double FileSizeInMB(this string filePath);
Fixes
- Fix digital storage measurements.
FluentExtensions 1.2
New Extensions Added:
- string AddToEnd(this string text, string textToAdd, bool addSpaceBeforeAddition = true);
- string AddToStart(this string text, string textToAdd, bool addSpaceafterAddition = true);
- string ReplaceMultipleWithOne(this string source, string[] values, string value)
- string Take(this string source, int characters, Position from = Position.Start);
- double ToKB(this int number, DigitalStorage from = DigitalStorage.KB);
- double ToMB(this int number, DigitalStorage from = DigitalStorage.MB);
- double ToGB(this int number, DigitalStorage from = DigitalStorage.GB);
- double ToTB(this int number, DigitalStorage from = DigitalStorage.TB);
FluentExtensions
- Fix misspellings.
- Update icon.