Ejemplo n.º 1
0
        public static List <GithubProfileModel> FromDbToModelGithubprofilesList(List <GithubProfile> dbProfile)
        {
            List <GithubProfileModel> allProfiles = new List <GithubProfileModel>();

            foreach (var profile in dbProfile)
            {
                GithubProfileModel temp = FromDbToModelForGithubProfileModel(profile);
                allProfiles.Add(temp);
            }
            return(allProfiles);
        }
Ejemplo n.º 2
0
        // Get a Github profile by id
        public GithubProfileModel GetAGithubProfile(int id)
        {
            GithubProfile dbProfile = monitoringContext.GithubProfile.Find(id);

            if (dbProfile == null)
            {
                GithubProfileModel nullModel = new GithubProfileModel();
                nullModel = null;
                return(nullModel);
            }
            else
            {
                return(Helper.FromDbToModelForGithubProfileModel(dbProfile));
            }
        }
Ejemplo n.º 3
0
        public static GithubProfileModel FromDbToModelForGithubProfileModel(GithubProfile dbGithubProfile)
        {
            GithubProfileModel profileModel = new GithubProfileModel();

            profileModel.UserName      = dbGithubProfile.UserName;
            profileModel.Url           = dbGithubProfile.Url;
            profileModel.Company       = dbGithubProfile.Company;
            profileModel.Name          = dbGithubProfile.Name;
            profileModel.Bio           = dbGithubProfile.Bio;
            profileModel.Location      = dbGithubProfile.Location;
            profileModel.Email         = dbGithubProfile.Email;
            profileModel.BlogOrWebsite = dbGithubProfile.BlogOrWebsite;
            profileModel.StarsCount    = dbGithubProfile.StarsCount;
            profileModel.LastUpdate    = dbGithubProfile.LastUpdate;
            return(profileModel);
        }