Beispiel #1
0
 public async Task <bool> Edit(int id, [Bind("ProjectId,Name,CreatedDate,ModifiedDate,Img,UserId")] Project project)
 {
     if (id != project.ProjectId)
     {
         return(false);
     }
     try
     {
         _context.Update(project);
         await _context.SaveChangesAsync();
     }
     catch (DbUpdateConcurrencyException)
     {
         if (!ProjectExists(project.ProjectId))
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #2
0
        public async Task <bool> Update(int id, [Bind("UserId,FirstName,LastName,EmailId")] Userdetails userdetails)
        {
            if (id != userdetails.UserId)
            {
                return(false);
            }

            try
            {
                _context.Update(userdetails);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserdetailsExists(userdetails.UserId))
                {
                    return(false);
                }
            }
            return(true);
        }