Exemple #1
0
        private static Dictionary <object, TModel> GetKeySortedData(IEnumerable <TModel> data)
        {
            var modelKeyProperty = KeyAttribute.GetKeyProperty(typeof(TModel));

            return(data.ToDictionary(modelObject => modelKeyProperty.GetValue(modelObject)));
        }
 public StorageService(IFileService fileService, IProjectPathsReadonlyService projectPathsService)
 {
     _fileService           = fileService;
     _projectPathsService   = projectPathsService;
     _dataObjectKeyProperty = KeyAttribute.GetKeyProperty(typeof(TDataObject));
 }
Exemple #3
0
 private string GetObjectPath <TModel>(TModel modelObject)
 {
     return(GetBaseEntityPath(typeof(TModel).Name) +
            $"{KeyAttribute.GetKeyProperty(typeof(TModel)).GetValue(modelObject)}" +
            $"{_fileService.FilesExtension}");
 }