public async Task <IActionResult> Edit(int id, [Bind("ListId,AngellistUrl,BlogUrl,CommunityProfile,CompanySize,CompanyType,CompanyUrl,Country,CreatedAt,CrunchbaseUrl,FacebookUrl,FollowerCount,HighConcept,Id,LinkedinUrl,Locations,LogoUrl,Markets,Name,ProductDesc,Quality,Screenshots,Status,ThumbUrl,TwitterUrl,UpdatedAt,VideoUrl")] AfricanStartup africanStartup)
        {
            if (id != africanStartup.ListId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(africanStartup);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AfricanStartupExists(africanStartup.ListId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(africanStartup));
        }
Пример #2
0
        public async Task Create(AfricanStartup africanStartup)
        {
            var result = await angelistContext.Set <AfricanStartup>().AddAsync(africanStartup);

            await angelistContext.SaveChangesAsync();
        }