Esempio n. 1
0
        public async Task <Rating> InsertAsync(RatingUpdateModel rating)
        {
            var result = await this.Context.AddAsync(this.Mapper.Map <DataAccess.Entities.Rating>(rating));

            await this.Context.SaveChangesAsync();

            return(this.Mapper.Map <Rating>(result.Entity));
        }
Esempio n. 2
0
        public async Task <Rating> UpdateAsync(RatingUpdateModel rating)
        {
            var existing = await this.Get(rating);

            var result = this.Mapper.Map(rating, existing);

            this.Context.Update(result);

            await this.Context.SaveChangesAsync();

            return(this.Mapper.Map <Rating>(result));
        }
Esempio n. 3
0
 public Task <Rating> UpdateAsync(RatingUpdateModel rating)
 {
     return(RatingDataAccess.UpdateAsync(rating));
 }
 public Task <Rating> CreateAsync(RatingUpdateModel rating)
 {
     return(RatingDataAccess.InsertAsync(rating));
 }