Exemplo n.º 1
0
        public async Task <int> UpdateAS(user user)
        {
            user sql = await WcDbContext.users.SingleAsync(u => u.UserId == user.UserId);

            sql.Username     = user.Username;
            sql.RoleId       = user.RoleId;
            sql.StatusUserId = user.StatusUserId;

            var n = await WcDbContext.SaveChangesAsync();

            return(n);
        }
Exemplo n.º 2
0
        public async Task <int> AddAs(nation nation)
        {
            WcDbContext.nations.Add(nation);
            var n = await WcDbContext.SaveChangesAsync();

            return(n);
        }
Exemplo n.º 3
0
        public async Task <int> RatingAs(Rating rating)
        {
            comic comic = await WcDbContext.comics.SingleAsync(c => c.ComicId == rating.ComicId);

            var numRating = comic.NumRating;

            comic.Rating    = ((comic.Rating * numRating) + rating.Point) / numRating++;
            comic.NumRating = numRating++;

            var n = await WcDbContext.SaveChangesAsync();

            return(n);
        }