예제 #1
0
        public IActionResult Get()
        {
            var db = new ProfileDBContext();


            var profile = db.Profile
                          .OrderByDescending(x => x.creationDate).Select(x => new
            {
                profile = new
                {
                    x.Id,
                    x.name,
                    x.title,
                    x.catchphrase,
                    x.birthdate,
                    x.localisation,
                    x.nationality,
                },

                x.experiences,
                x.languages,
                x.contacts,
                x.skills,
                x.educations,
            }).FirstOrDefault();

            return(new JsonResult(profile));
        }
예제 #2
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="profilecontext"></param>
        /// <param name="huapidbcontext"></param>
        /// <param name="stagecontext"></param>
        /// <param name="cfg"></param>
        /// <param name="logger"></param>
        public SQLProfileDAL(ProfileDBContext profilecontext, HUAPIDBContext huapidbcontext, ProfileStageDBDataContext stagecontext, IOptions <CustomConfig> cfg, ILogger <SQLProfileDAL> logger)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Restart();

            _logger                = logger;
            _cfg                   = cfg;
            _huapidbcontext        = huapidbcontext;
            _profiledbcontext      = profilecontext;
            _profilestagedbcontext = stagecontext;
            sourceDBName           = profilecontext.Database.GetDbConnection().Database;
            stageDBName            = stagecontext.Database.GetDbConnection().Database;

            stopwatch.Stop();
            _logger.LogDebug($"profile db data context time required for the first query: {stopwatch.ElapsedMilliseconds / 1000} seconds.");
        }
예제 #3
0
 public RepositoryWrapper(ProfileDBContext repositoryContext)
 {
     _repoContext = repositoryContext;
 }
예제 #4
0
 public RepositoryBase(ProfileDBContext repositoryContext)
 {
     this.RepositoryContext = repositoryContext;
 }
예제 #5
0
 public ProfileRepository(ProfileDBContext repositoryContext)
     : base(repositoryContext)
 {
 }
 public CommentChannelRepository(ProfileDBContext repositoryContext)
     : base(repositoryContext)
 {
 }
예제 #7
0
 public CommentVideoRepository(ProfileDBContext repositoryContext)
     : base(repositoryContext)
 {
 }
예제 #8
0
 public VideosRepository(ProfileDBContext repositoryContext)
     : base(repositoryContext)
 {
 }