Example #1
0
 public static Result <ResourceEdmx> HexToBase64(DatabaseEdmx databaseEdmx) =>
 FlowHelpers.With(databaseEdmx)
 .Map(edmx => HexModule.CutOffHexPrefix(databaseEdmx.Value))
 .OnSuccessTry <Hex, ByteArray, FormatException>(edmx => HexToBytes(edmx), "Invalid hexidecimal format.")
 .OnSuccess(edmx => Base64Module.BytesToBase64(edmx))
 .OnSuccess(base64 => base64.ToResourceEdmx());
Example #2
0
 public static Result <ResourceEdmx> GZipToBase64(GZipBinary source) =>
 FlowHelpers.With(source)
 .OnSuccess(edmx => Base64Module.BytesToBase64(edmx.ByteArray)
            .OnSuccess(base64 => new ResourceEdmx(base64)));
Example #3
0
 internal static Result <Edmx> ConvertToDatabase(ResourceEdmx xmlEdmx) =>
 Base64Module.Base64ToByteArray(xmlEdmx)
 .OnSuccess(edmx => MiscModule.BytesToHex(edmx))
 .Map(edmx => edmx.ToDatabaseEdmx())
 .Map(edmx => edmx as Edmx);