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)); }
private string GetObjectPath <TModel>(TModel modelObject) { return(GetBaseEntityPath(typeof(TModel).Name) + $"{KeyAttribute.GetKeyProperty(typeof(TModel)).GetValue(modelObject)}" + $"{_fileService.FilesExtension}"); }