public async Task <StoreArtist> Create(StoreArtist entity) { if (entity == null) { throw new Exception("Entity cannot be null"); } var result = await _dbContext.StoreArtists.AddAsync(entity); await _dbContext.SaveChangesAsync(); return(result.Entity); }
public async Task <StoreArtist> Update(StoreArtist entity) { if (entity == null) { throw new Exception("Entity cannot be null"); } _dbContext.StoreArtists.Attach(entity); var entry = _dbContext.Entry(entity); entry.State = EntityState.Modified; await _dbContext.SaveChangesAsync(); return(entry.Entity); }