Ejemplo n.º 1
0
        private static ProjectDetails GetProjectDetails(
            Project project,
            IReadOnlyDictionary <string, int> mapping,
            string userId)
        {
            var result = ProjectDetails.FromProject(project);

            result.Backers   = mapping.Count;
            result.CanBackup = !mapping.ContainsKey(userId);
            //TODO: value should be cached and stored in a dictionary
            result.Funded = mapping.Sum(item => item.Value);
            return(result);
        }