コード例 #1
0
        public async Task<IHttpActionResult> Upload()
        {
            Repository repo = new Repository();
            var users = repo.Users.Any();
            var gen = new EntityGenerator<TestModel>();
            var model = await gen.FromMultipartFormData(Request.Content, typeof(TestModel));

            if (model != null)
                return Ok();
            else
                return InternalServerError();
        }
コード例 #2
0
        public IList<Entities.CurrentStatistic> RetrieveProfile(Repository.IProfileRepository repository)
        {
            //retrieve from cache
            IList<CurrentStatistic> profile = ProfileClient.RetrieveProfile();
            if (profile == null)
            {
                //retrieve from database
                profile = repository.RetrieveProfile();
                //save to cache
                ProfileClient.SaveProfile(profile);
            }

            return profile;
        }
コード例 #3
0
        public IList<Entities.ContestEventGoal> RetrieveGoals(Repository.IProfileRepository repository)
        {
            //retrieve from cache
            IList<ContestEventGoal> goals = ProfileClient.RetrieveGoals();
            if (goals == null)
            {
                //retrieve from database
                goals = repository.RetrieveGoals();
                //save to cache
                ProfileClient.SaveGoals(goals);
            }

            return goals;
        }
コード例 #4
0
        public void RemoveImageTest()
        {
            // 준비
            Repository repository = new Repository();
            PictureRepo repo = new PictureRepo();
            ImageData data = repo.Get(91);
            int exifidx = data.ExifIdx.Value;
            int thumbidx = data.ThumbnailIdx.Value;

            // 실행
            repo.Remove(data.Idx);

            // 검증
            Assert.IsNull(repo.Get(91));
            Assert.IsNull(repository.Thumbnails.SingleOrDefault(model => model.Idx == thumbidx));
            Assert.IsNull(repository.Exifs.SingleOrDefault(model => model.Idx == exifidx));
        }
コード例 #5
0
 public PictureRepo(Repository repo)
     : base(repo)
 {
 }
コード例 #6
0
 public BaseRepository(BaseRepository entity)
 {
     _repo = entity._repo;
 }
コード例 #7
0
 public BaseRepository(Repository repo)
 {
     _repo = repo;
 }
コード例 #8
0
 public BaseRepository()
 {
     _repo = new Repository();
 }
コード例 #9
0
 public AlbumRepo(Repository repo)
     : base(repo)
 {
 }