public static ICrateStorage GetStorage(this ICrateManager crateManager, string crateStorageRaw)
        {
            if (string.IsNullOrWhiteSpace(crateStorageRaw))
            {
                return(new CrateStorage());
            }

            return(crateManager.FromDto(StringToCrateStorageDTOConverter.Convert(crateStorageRaw)));
        }
Example #2
0
            private ICrateStorage ReadStorage(object value)
            {
                if (value is string)
                {
                    return(CrateStorageSerializer.Default.ConvertFromDto(StringToCrateStorageDTOConverter.Convert((string)value)));
                }

                if (value is CrateStorageDTO)
                {
                    return(CrateStorageSerializer.Default.ConvertFromDto((CrateStorageDTO)value));
                }

                return(new CrateStorage());
            }