コード例 #1
0
ファイル: ShortUrlRepository.cs プロジェクト: xcjs/u413
 /// <summary>
 /// Deletes a short URL from the data context.
 /// </summary>
 /// <param name="shortUrl">The short URL to be deleted.</param>
 public void DeleteShortUrl(ShortURL shortUrl)
 {
     _entityContainer.ShortURLs.Remove(shortUrl);
     _entityContainer.SaveChanges();
 }
コード例 #2
0
ファイル: ShortUrlRepository.cs プロジェクト: xcjs/u413
 /// <summary>
 /// Adds a short URL to the data context.
 /// </summary>
 /// <param name="shortUrl">The short URL to be added.</param>
 public void AddShortUrl(ShortURL shortUrl)
 {
     _entityContainer.ShortURLs.Add(shortUrl);
     _entityContainer.SaveChanges();
 }