Exemplo n.º 1
0
        public static string MakeAppDataFilePath(this IFileDbHelper helper, params string[] paths)
        {
            var items = new List <string>();

            items.Add("App_Data");
            foreach (var path in paths)
            {
                if (!string.IsNullOrWhiteSpace(path))
                {
                    items.Add(path);
                }
            }
            return(FileHelper.Instance.CombineBaseDirectory(items.ToArray()));
        }
Exemplo n.º 2
0
 public static void Save <T>(this IFileDbHelper helper, string path, params T[] items)
 {
     helper.Save(path, items.ToList());
 }
Exemplo n.º 3
0
 public static Task SaveAsync <T>(this IFileDbHelper helper, string path, params T[] items)
 {
     return(helper.SaveAsync(path, items.ToList()));
 }
Exemplo n.º 4
0
        public static string MakeFileName(this IFileDbHelper helper, Type type, string suffix = ".json")
        {
            string className = type.GetFriendlyFileName();

            return($"{className}{suffix}");
        }
Exemplo n.º 5
0
        public static string MakeFileName <T>(this IFileDbHelper helper, string suffix = ".json")
        {
            Type type = typeof(T);

            return(helper.MakeFileName(type, suffix));
        }